简体   繁体   中英

How do I get my subclass of UIView to appear in Interface Builder?

I'm trying to share as much code between my common UIViews as possible by subclassing UIView.

Is there a way to make this UIView accessable in Interface Builder?

What's the best way to reuse hand-coded UIViews in Cocoa?

在界面构建器中的窗口/视图中添加普通的UIView,然后在Identity Inspector中,将该类的名称更改为UIView子类。

If you want to make your custom views available in interface builder permanently, you could create a plugin for interface builder.

See here: How do you display custom UIViews in InterfaceBuilder?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM