如何在 XCode 4 iOS 项目中添加自定义视图类?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5926477/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 20:59:08  来源:igfitidea点击:

How to add Custom View class in XCode 4 iOS Project?

xcodeinterfacebuilder

提问by Wu Guoquan

I create a subclass of UIView named "WebViewContainer", In Interface Builder 3 ,we can drag the WebViewContainer to MainViewController, but in xcode 4, I couldn't find that, in the "Custom Objects", it's empty:(

我创建了一个名为“WebViewContainer”的 UIView 子类,在 Interface Builder 3 中,我们可以将 WebViewContainer 拖到 MainViewController,但是在 xcode 4 中,我找不到,在“自定义对象”中,它是空的:(

回答by Manny

Drag a view object in to the window and change its default class to "WebViewContainer".

将视图对象拖入窗口并将其默认类更改为“WebViewContainer”。

See this video on youtube http://www.youtube.com/watch?v=-u-Kdp-lYgM

在 youtube 上观看此视频http://www.youtube.com/watch?v=-u-Kdp-lYgM