在Xcode 3.x中,将xib从iPhone版转变为iPad版,通过Create iPad Version菜单。
但在Xcode 4.x中,这个菜单找不到了。通过一番摸索,笔者发现可以用如下方法将xib转换为iPad版本。
1、修改xib源文件
xib文件其实是一个xml文件,你可以以文本方式编辑和修改它。在Project Navigator中,在xib文件上右键,选择“Open As ->Source Code”,即可以源代码方式查看xib文件,找到"com.apple.InterfaceBuilder3.CocoaTouch.XIB"一行,将其改为 "com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB",即在".XIB"前插入一个".iPad"。
按下⌘+F,打开搜索栏,点击Replace菜单,将模式改变替换模式。将xib文件中所有"IBCocoaTouchFramework"用 "IBIPadFramework"替换。
按下⌘+S,保存修改。
2、修改xib的视图尺寸
在xib文件上右键,选择“Open As -> Interface Builder – iOS”,用IB模式打开。
选择xib文件中的根视图(UIView),在属性面板中找到Size选项,将其改为Full iPad Screen.
现在,你可以有一个iPad版本的xib了。
但在Xcode 4.x中,这个菜单找不到了。通过一番摸索,笔者发现可以用如下方法将xib转换为iPad版本。
1、修改xib源文件
xib文件其实是一个xml文件,你可以以文本方式编辑和修改它。在Project Navigator中,在xib文件上右键,选择“Open As ->Source Code”,即可以源代码方式查看xib文件,找到"com.apple.InterfaceBuilder3.CocoaTouch.XIB"一行,将其改为 "com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB",即在".XIB"前插入一个".iPad"。
按下⌘+F,打开搜索栏,点击Replace菜单,将模式改变替换模式。将xib文件中所有"IBCocoaTouchFramework"用 "IBIPadFramework"替换。
按下⌘+S,保存修改。
2、修改xib的视图尺寸
在xib文件上右键,选择“Open As -> Interface Builder – iOS”,用IB模式打开。
选择xib文件中的根视图(UIView),在属性面板中找到Size选项,将其改为Full iPad Screen.
现在,你可以有一个iPad版本的xib了。
分享到:
相关推荐
xib2Storyboard - 将Xcode .xib转换为.storyboard文件的工具
Xcode 插件:用来简化代码格式.zip,清除闭包语法的xcode源代码编辑器扩展。
Xcode6.1创建仅xib文件无storyboard的hello world应用
Learn the critical tips and techniques to make using Xcode for the iPhone, iPad, or Mac easier, and even fun. Explore the features and functionality of Xcode you may not have heard of. Go under the ...
AddJackTemplates - xcode定制文件模板,UIView绑定xib一键生成,统一头文件标题样式
This completely revised and updated edition of the bestselling iOS guide shows you how to pull in the SDK's enormous feature set and deliver powerful, real-world apps for iPhone and iPad using modern...
Get a solid grounding in all the fundamentals of Cocoa Touch, and avoid problems during iPhone and iPad app development. With Programming iOS 4, you'll dig into Cocoa and learn how to work effectively...
Xcode 12.3真机调试包,操作如下: 前往--应用程序/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport文件夹,拖到文件目录下之后重启 Xcode 即可
这里主要是把静态库种的.xib封装到bundle中,然后把静态库内链到工程中。
Xcode 4 快速入门教程:[1] Xcode 4 Project Setup 视频
Developing iOS 7 Apps for iPhone and iPad ppt (1-10) 最新 xcode 5的 斯坦福 ios 公开课 ppt
iPhone SDK 3.1.3 with xCode 3.2.1 bt下载种子链接
网上很多静态库制作教程,但都只是打包方法,没有讲述如何打包资源文件(xib,图片等)的教程。我结合老外写的一边文章,制作出了包含资源文件的静态库,简单写了一边制作流程,分享给大家。有什么问题,请留言,...
[iOS iPhone iPad 基础开发视频] 第二讲 - 使用Xcode 4开发基础程序
A Learner’s Guide to Creating Objective-C Applications for the iPhone and iPad Book Description : Let’s say you have a killer app idea for iPhone and iPad. Where do you begin? Head First iPhone and...
Xcode8.2.1百度网盘 链接:https://pan.baidu.com/s/1vJz83ZS5dyx-qXTBMXsk-A 提取码: 复制这段内容后打开百度网盘手机App,操作更方便哦
本书教会读者使用Xcode开发环境第4版为iPhone构建自己的应用程序所需的技能。
How to create exciting interactive apps for iPhone or iPad using Sprite Kit, Map Kit, and other Apple technologies How to share your app using organizer, localization, auto layout, and more Who this ...
让xcode9.1支持 iOS11.2,,不能设置免费了。。。 xcode 11.2 https://pan.baidu.com/s/1i4Yit5j ...xcode路径:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
Xcode 没有比任何时候都可帮助您创建高质量的应用程序。它自动配置您的应用程序以使用最新的苹果服务、 管理统一的资产目录中的图像,并可帮助您设计令人惊叹的接口为 7 的 iOS 和 OS X。它也容易地分析您的代码、 ...