Lớp GCKUIButton
Một lớp con của UIButton hỗ trợ trạng thái ứng dụng tuỳ chỉnh.
Các trạng thái này được OR chuyển vào giá trị thuộc tính state của nút để cung cấp các trạng thái bổ sung dành riêng cho ứng dụng. Bạn có thể chỉ định hình ảnh cho các trạng thái tuỳ chỉnh sau, ví dụ:
[nút setImage:[UIImage imageNamed:@"myCustomStateImage"]
forState:(UIControlStateNormal | kMyControlStateCustom)];
Giá trị trạng thái ứng dụng chỉ được dùng các bit được đặt trong mặt nạ bit UIControlStateApplication.
- Deprecated:
- Sử dụng GCKUIMultistateButton.
- Năm thành lập
- 3.0
Kế thừa GCKUIMultistateButton.
- (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. |
- (UIControlState) applicationState |
|
readwritenonatomicassign |
Trạng thái ứng dụng của nút.
Trạng thái này được chuyển bằng OR vào trạng thái hiện tại của nút.
- (NSUInteger) buttonState |
|
readwritenonatomicassigninherited |
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: 2023-12-02 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2023-12-02 UTC."],[[["GCKUIButton is a subclass of UIButton that supports custom application states, allowing developers to assign images to these states for enhanced UI customization."],["This class is deprecated since version 3.0 and developers should use GCKUIMultistateButton instead."],["Application state values should only use bits defined in the UIControlStateApplication bitmask to ensure compatibility and avoid conflicts."],["`setImage:forButtonState:` method allows setting images for specific button states, providing visual feedback to users."],["The `applicationState` property represents the button's current application state, which is ORed with the existing state to combine multiple states."]]],["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"]]