Lớp GCKUIMultistateButton
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Một lớp con của UIButton hỗ trợ nhiều trạng thái.
Gán một hình ảnh cho mỗi trạng thái bằng phương thức setImage:forButtonState: (GCKUIMultistateButton).
- Năm thành lập
- 4
Kế thừa UIButton.
Kế thừa từ GCKUIButton.
- (void) setImage: |
|
(UIImage *) |
image |
forButtonState: |
|
(NSUInteger) |
buttonState |
|
|
| |
Thiết lập hình ảnh để hiển thị cho một trạng thái nút cụ thể.
- Parameters
-
image | The image. |
buttonState | The button state. |
- (NSUInteger) buttonState |
|
readwritenonatomicassign |
Trạng thái ứng dụng của nút.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\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."]]