开发者

iPhone: How to create a UIButton from a xib, or a UIView

开发者 https://www.devze.com 2023-03-30 16:33 出处:网络
Is there some way to make a custom UIButton which apparence inherits from a xib file or a uiview? In android I can inflate a layout and use it as the view of a button, is this possible in iphone?

Is there some way to make a custom UIButton which apparence inherits from a xib file or a uiview?

In android I can inflate a layout and use it as the view of a button, is this possible in iphone?

I created a class that inherits from UIButton, and tried to create a xib file for it with a view where I could place other开发者_StackOverflow中文版 elements inside and link them to the class. I made this view the type of my class, but it did not seem to work as I expected.


UIButton inherits directly from UIView so yes, you can utilized a customized UIView for a UIButton.

0

精彩评论

暂无评论...
验证码 换一张
取 消