iphone - iOS - 在 iphone 5 分辨率上支持 xib

标签 iphone ios ios5 ios6

我在 xib 文件中设计了一个 3.5 大小的 View 。当我以 iphone 5 分辨率运行时,它会在底部显示一个空格。

有没有办法支持一个 xib 进入两种分辨率。

谢谢。

编辑

if( IS_IPHONE_5 )
{
    _helpButton = [[UIButton alloc] initWithFrame:self.view.bounds];
    _LogoImage = [[UIImageView alloc] initWithFrame:self.view.bounds];
    [_helpButton setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
    [_LogoImage setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
    CGRect frameRect = _helpButton.frame;
    frameRect.origin.y += 300;
    _helpButton.frame = frameRect;

}

最佳答案

要么 1) 打开 xib 文件的自动布局,让它根据屏幕高度自动调整,要么 2) 关闭自动布局,然后设置字符串和支柱以根据其大小扩展 View ,或者 3) 使用 socket 并以编程方式设置它的高度。

关于iphone - iOS - 在 iphone 5 分辨率上支持 xib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14746015/

相关文章:

ios - 动画 UIView 的内容不接收触摸事件

iphone - UILabel 的 sizeThatFits 是否返回它的高度?

iphone - 闪屏时崩溃,iPhone

iphone - iTunes 连接 : Excluding iPad From Supported Devices

iphone - 带有框架、图标和图像的自定义 MKAnnotationView

iOS5 NSFetchedResultsController 没有得到删除更新

iphone - 如何更改铃声模式(静音或振动)

ios - 将自定义单元格 ImageView 图像传递给新的 View Controller

iphone - ViewDidLoad() 中的调用方法

ios - 使用 Swift 4 关闭 iOS 中的所有模式