کلاس GCKUIButton
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
یک زیر کلاس از UIButton که از حالت های برنامه سفارشی پشتیبانی می کند.
این حالتها بر روی مقدار ویژگی حالت دکمه OR میشوند تا حالتهای اضافی و ویژه برنامه را ارائه دهند. تصاویر را می توان به این حالت های سفارشی اختصاص داد، به عنوان مثال:
[button setImage:[UIImage imageNamed: @"myCustomStateImage" ]
forState:(UIControlStateNormal | kMyControlStateCustom)];
مقادیر حالت برنامه فقط باید از بیت هایی استفاده کنند که در بیت ماسک UIControlStateApplication تنظیم شده اند.
- Deprecated:
- از GCKUIMultistateButton استفاده کنید.
- از آنجا که
- 3.0
GCKUIMultistateButton را به ارث می برد.
- (void) setImage: |
|
(UIImage *) |
image |
forButtonState: |
|
(NSUInteger) |
buttonState |
|
|
| |
تصویر را برای نمایش وضعیت دکمه مشخص تنظیم می کند.
- Parameters
-
image | The image. |
buttonState | The button state. |
- (UIControlState) applicationState |
|
read write nonatomic assign |
وضعیت کاربرد دکمه
این حالت بر روی حالت موجود دکمه OR شده است.
- (NSUInteger) buttonState |
|
read write nonatomic assign inherited |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eGCKUIButton is a subclass of UIButton that supports custom application states, allowing developers to assign images to these states for enhanced UI customization.\u003c/p\u003e\n"],["\u003cp\u003eThis class is deprecated since version 3.0 and developers should use GCKUIMultistateButton instead.\u003c/p\u003e\n"],["\u003cp\u003eApplication state values should only use bits defined in the UIControlStateApplication bitmask to ensure compatibility and avoid conflicts.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esetImage:forButtonState:\u003c/code\u003e method allows setting images for specific button states, providing visual feedback to users.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eapplicationState\u003c/code\u003e property represents the button's current application state, which is ORed with the existing state to combine multiple states.\u003c/p\u003e\n"]]],["The GCKUIButton class, a subclass of UIButton, supports custom application states via the `state` property. Custom states are combined with the button's existing state. Images can be assigned to these custom states using `setImage:forButtonState:`. The `applicationState` property is ORed onto the button's state. The `buttonState` represents the button's state. Application states should use only bits within the `UIControlStateApplication` bitmask. The GCKUIButton is deprecated, and developers should use GCKUIMultistateButton instead.\n"],null,["# GCKUIButton Class\n\n[Instance Methods](#pub-methods) \\| [Properties](#properties) \nGCKUIButton Class Reference \n\nOverview\n--------\n\nA subclass of [**UIButton**](https://goo.gl/VK61wU) that supports custom application states.\n\nThese states are ORed onto the value of the button's **state** property to provide additional, application-specific states. Images can be assigned to these custom states, for example: \n\\[button setImage:\\[UIImage imageNamed:@\"myCustomStateImage\"\\] \nforState:(UIControlStateNormal \\| kMyControlStateCustom)\\];\n\nApplication state values must only use the bits that are set in the [**UIControlStateApplication**](https://goo.gl/tZWsqZ) bitmask.\n\n**[Deprecated:](/cast/docs/reference/ios/deprecated#_deprecated000040)**\n: Use [GCKUIMultistateButton](/cast/docs/reference/ios/interface_g_c_k_u_i_multistate_button \"A subclass of UIButton that supports multiple states. \").\n\n Since\n : 3.0\n\nInherits [GCKUIMultistateButton](/cast/docs/reference/ios/interface_g_c_k_u_i_multistate_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| UIControlState | [applicationState](/cast/docs/reference/ios/interface_g_c_k_u_i_button#a1457e5e718738775b004a167c8591426) |\n| | The button's application state. [More...](#a1457e5e718738775b004a167c8591426) |\n| ||\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| |-------------------------------------| | - (UIControlState) applicationState | | readwritenonatomicassign |\n\nThe button's application state.\n\nThis state is ORed onto the button's existing state. \n\n|---------------------------------------------------------------|-----------------------------------|\n| |----------------------------| | - (NSUInteger) buttonState | | readwritenonatomicassigninherited |\n\nThe button's application state."]]