簡體   English   中英

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

[英]iOS - Support xib on iphone 5 Resolution

我在xib文件中設計了一個3.5大小的視圖。 當我在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)關閉自動布局,然后設置字符串和支柱根據它的大小增大視圖或3)使用插座和編程設定它的高度。

沒關系你有3.5英寸設備的xib,如果支持iOS <6.0,請不要使用AutoLayout

你必須像下面那樣設置你的UIView resize屬性,應用程序應該正常工作而不做任何改動。

自動調整視圖大小

檢查你的視圖是否有硬編碼的高度

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM