简体   繁体   English

我如何为iphone3.5和iphone 4英寸屏幕(ios6和ios7)设计Single xib?

[英]How can i design Single xib for iphone3.5,and iphone 4 inch screen (ios6 and ios7)?

I created my application as tabbar application with iphone screens. 我使用iphone屏幕将我的应用程序创建为tabbar应用程序。 It works well earlier. 它运作得很早。 Now i want to change my tabbar application to support for iphone3.5 and 4 inch screen (in ios6 and ios7). 现在我想更改我的tabbar应用程序以支持iphone3.5和4英寸屏幕(在ios6和ios7中)。 In past i have designed only single xib for this. 在过去,我只为此设计了单个xib。

is it possible to support all those screens with single xib? 是否有可能用单个xib支持所有这些屏幕? Please help me on this. 请帮帮我。

Notes: 笔记:

I have latest xcode5. 我有最新的xcode5。 I have tried autoresizing , but it is very difficult to understand. 我尝试过autoresizing,但很难理解。 Because its work for 3.5 inch screen and 4 inch screen in ios6 but view goes out of the screen in ios7. 因为它在ios6中用于3.5英寸屏幕和4英寸屏幕,但视图在ios7中不在屏幕上。

That's not because of the size. 那不是因为大小。

In iOS7 both top and bottom bars are transparent.. That's why your views get resized and covered by the bars. 在iOS7中,顶部和底部条都是透明的。这就是为什么您的视图会被调整大小并被条形图覆盖。

To fix this simply add this lines to your viewDidLoad method: 要解决此问题,只需将此行添加到viewDidLoad方法:

if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)])
    self.edgesForExtendedLayout = UIRectEdgeNone;
if ([self.tabBar respondsToSelector:@selector(setTranslucent:)])
    self.tabBar.translucent = NO;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何编写适用于iOS 6和iOS 7的iPhone 3.5英寸屏幕和4英寸屏幕的代码 - how can i write the code for iphone 3.5 inches screen and 4 inches screen for ios6 & ios7 如何使用一个故事板用于带有自动布局(ios6 + ios7)的4英寸和3.5英寸iphone屏幕? - how can I use one storyboard for 4“ and 3.5” iphone screens with autolayout (ios6 + ios7)? 如何在iOS7上为iPhone 3.5英寸创建单独的.storyboard? - How can I create a separate .storyboard for iPhone 3.5 inch on iOS7? 在3.5英寸和4英寸iPhone屏幕上同时显示图像时,如何使图像居中? - How can I center a image when it is displayed in both 3.5 inch and 4 inch iphone screen? ioS更改按钮图像以填充iPhone 3.5英寸和iPhone 4英寸的屏幕 - ioS change button images to fill up the screen for iphone 3.5 inch and iphone 4 inch iPhone 3.5英寸屏幕 - 4英寸屏幕: - iPhone 3.5 Inch screen - 4 inch screen: 我如何在iPhone iOS6中为UINavigationController处理UIInterfaceOrientationPortraitUpsideDown - How can i handle UIInterfaceOrientationPortraitUpsideDown for UINavigationController in iPhone iOS6 检测是否在iPad或iPhone(iOS6和iOS7)上安装了应用 - Detect if an app is installed on iPad or iPhone (iOS6 & iOS7) 如何在ios6中设置iphone 4和iphone 5的帧 - How to set the frame for iphone 4 and iphone 5 in ios6 从iPhone 4英寸屏幕xib的iPhone 3.5“模拟器中更改了视框 - View frame changed in the iPhone 3.5" simulator from iPhone 4-inch screen xib
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM