GCKUIMultistateButton 类
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
继承 UIButton。
由 GCKUIButton 继承。
- (void) setImage: |
|
(UIImage *) |
image |
forButtonState: |
|
(NSUInteger) |
buttonState |
|
|
| |
设置要针对指定按钮状态显示的图片。
- Parameters
-
image | The image. |
buttonState | The button state. |
- (NSUInteger) buttonState |
|
readwritenonatomicassign |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003e\u003ccode\u003eGCKUIMultistateButton\u003c/code\u003e is a subclass of \u003ccode\u003eUIButton\u003c/code\u003e that supports multiple states, allowing you to assign different images for each state.\u003c/p\u003e\n"],["\u003cp\u003eYou can set the image for a specific button state using the \u003ccode\u003esetImage:forButtonState:\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuttonState\u003c/code\u003e property indicates the current application state of the button.\u003c/p\u003e\n"],["\u003cp\u003eThis class is available since version 4.0 of the framework and is inherited by \u003ccode\u003eGCKUIButton\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# GCKUIMultistateButton Class\n\n[Instance Methods](#pub-methods) \\| [Properties](#properties) \nGCKUIMultistateButton Class Reference \n\nOverview\n--------\n\nA subclass of [**UIButton**](https://goo.gl/VK61wU) that supports multiple states.\n\nAssign an image to each state with the [setImage:forButtonState: (GCKUIMultistateButton)](/cast/docs/reference/ios/interface_g_c_k_u_i_multistate_button#afa6a9b60ccbe99ae3dd6fdd1f92225e3 \"Sets the image to display for a given button state. \") method.\n\nSince\n: 4.0\n\nInherits UIButton.\n\nInherited by [GCKUIButton](/cast/docs/reference/ios/interface_g_c_k_u_i_button).\n\n|--------|--------------------------------------------------------------------------------------------------------------------------------|\n| Instance Method Summary ----------------------- ||\n| (void) | - [setImage:forButtonState:](/cast/docs/reference/ios/interface_g_c_k_u_i_multistate_button#afa6a9b60ccbe99ae3dd6fdd1f92225e3) |\n| | Sets the image to display for a given button state. [More...](#afa6a9b60ccbe99ae3dd6fdd1f92225e3) |\n| ||\n\n|------------|-----------------------------------------------------------------------------------------------------------------|\n| Property Summary ---------------- ||\n| NSUInteger | [buttonState](/cast/docs/reference/ios/interface_g_c_k_u_i_multistate_button#a51dc394e64d3837d6bffcad409f3f0f4) |\n| | The button's application state. [More...](#a51dc394e64d3837d6bffcad409f3f0f4) |\n| ||\n\nMethod Detail\n-------------\n\n|--------------------|---|--------------|---------------|\n| - (void) setImage: | | (UIImage \\*) | *image* |\n| forButtonState: | | (NSUInteger) | *buttonState* |\n| | | | |\n\nSets the image to display for a given button state.\n\nParameters\n:\n\n |-------------|-------------------|\n | image | The image. |\n | buttonState | The button state. |\n\n\nProperty Detail\n---------------\n\n|---------------------------------------------------------------|--------------------------|\n| |----------------------------| | - (NSUInteger) buttonState | | readwritenonatomicassign |\n\nThe button's application state."]]