iPhone - Creating custom objects for Interface Builder?

烂漫一生 提交于 2019-11-30 04:12:43

问题


I am currently subclassing UIView to create custom objects, they work perfectly fine

In interface builder i drag and drop a uiview and I set the class name to my custom view, and in runtime the view will populate according to my code.

QUESTION: Is it possible to make it so that my custom view DRAWS in interface builder, And maybe drag and drop my custom view ?


回答1:


I've researched this myself a while back, as far as i know this is not possible using the iPhone SDK. When developing for the Mac SDK you can create your own IB plugins.




回答2:


You need to add the custom view to the Interface Builder library. Go to File -> Read Class Files... in interface builder, and select your header file to add your item to interface builder's list.



来源:https://stackoverflow.com/questions/4411208/iphone-creating-custom-objects-for-interface-builder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!