开发者

How do I add custom UIButton to nib file in XCode?

开发者 https://www.devze.com 2023-02-18 22:17 出处:网络
I\'ve just begin delving in to the world of iOS development.I am also a newbie to XCode.I\'ve built several little test apps nows using the default UIComponents available by dragging and dropping them

I've just begin delving in to the world of iOS development. I am also a newbie to XCode. I've built several little test apps nows using the default UIComponents available by dragging and dropping them from the Objects library on to my .xib file and hooking up outlets and actions just to see how it all works. I wanted to take it to the next step and create my own custom painted button. I have a class named CustomButton that extends UIButton and I can programmatically add it to a view, but I would like to know how to drag and drop i开发者_StackOverflow中文版t on to a nib file so I can lay it out visually rather than programmatically. I know this is a beginner question but I've searched all night trying to find an example of how to do it with no success. Any help is greatly appreciated.


Drop in a UIView into your nib and set its Custom Class to your UIButton subclass.

How do I add custom UIButton to nib file in XCode?

0

精彩评论

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