Adding custom buttons to iphone app
How can I use a custom button instead of a predefined b开发者_高级运维utton object in the interface builder?
If it is a custom subclass of UIButton
, add a "button" as usual, and in the inspector set the class to be your subclass, and set the type to "custom." If it is a "button-like-view" that is not a subclass of UIButton
, then add a "custom view" and set its class to be your subclass. When possible, "button-like things" should be subclasses of UIButton
but this isn't always appropriate.
Usually you provide an image in your project to be used as the custom button.You can provide different images based on the "state" of the button. (Default
, Higlighted
, Selected
, Disabled
)
Other than that it should behave just as a regular UIButton
.
精彩评论