您的位置:首页 > 产品设计 > UI/UE

iOS UIViewController 和 xib 绑定 详解

2017-09-12 16:19 507 查看
原文地址:iOS UIViewController
和 xib 绑定 详解
1> 创建 UIViewController,此处不选择 Alse create XIB file



2> 创建 xib 文件



3> 在 xib 中,点击 Placeholder -> File’s Owner
在右边 Show the Identity inspector ,在 Class 中设置 xib 需要绑定 UIViewController





4> 在左边,右键 View,左键点击 New Referencing Outlet 拖至 Placeholder -> File’s Owner



5> 再点击 View 这样 UIViewController 和 xib 绑定成功



常见问题 : 
1> loaded the "XXXView" nib but the view outlet was not set
检查 Class 是否为 xxxViewControler,另外检查是否 IBOutlet 绑定 view
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息