ระดับของปุ่ม GCKUI
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คลาสย่อยของ UIButton ที่รองรับสถานะแอปพลิเคชันที่กำหนดเอง
สถานะเหล่านี้จะใช้ OR กับค่าคุณสมบัติstateของปุ่มเพื่อให้สถานะเพิ่มเติมที่เจาะจงแอปพลิเคชัน คุณกําหนดรูปภาพให้กับสถานะที่กําหนดเองเหล่านี้ได้ เช่น
[button setImage:[UIImageNamed:@"myCustomStateImage"]
forState:(UIControlStateในระหว่างที่ | kMyControlStateCustom)];
ค่าสถานะของแอปพลิเคชันต้องใช้เฉพาะบิตที่ตั้งค่าไว้ในบิตมาสก์ UIControlStateApplication
- Deprecated:
- ใช้ GCKUIMultistateButton
- Since
- 3.0
รับค่า GCKUIMultistateButton
- (void) setImage: |
|
(UIImage *) |
image |
forButtonState: |
|
(NSUInteger) |
buttonState |
|
|
| |
กำหนดภาพที่จะแสดงสำหรับสถานะของปุ่มที่ระบุ
- Parameters
-
image | The image. |
buttonState | The button state. |
- (UIControlState) applicationState |
|
readwritenonatomicassign |
สถานะแอปพลิเคชันของปุ่ม
สถานะนี้จะปรับตามสถานะเดิมของปุ่ม
- (NSUInteger) buttonState |
|
readwritenonatomicassigninherited |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\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,[]]