Developing same UI for 3.5, 4.0 (updated 4.7 and 5.5) inches screens in Xcode 5.0.1 (updated xcode 6), no landscape, no iPad and no storyboard

后端 未结 5 782
生来不讨喜
生来不讨喜 2020-12-23 12:37
  1. I have developed app considering 3.5 inch with .xib files and not storyboard.
  2. I am unable to find any tutorial or guide which will help me in designing app si
5条回答
  •  心在旅途
    2020-12-23 13:15

    You can use auto layout or code. In code you can use layoutSubviews method. Just check view height to discover is it a iPhone 3.5 or 4 inch and do your set up:

    -(void)layoutSubviews
    {
        if (self.view.bounds.size.height == 568)
        {
            [self.textField setFrame:CGRectMake(0, 0, 100, 30)];
            //... other setting for iPhone 4inch
        }
        else
        {
            [self.textField setFrame:CGRectMake(0, 0, 100, 30)];
            //... other setting for iPhone 3.5 inch
        }
    }
    

提交回复
热议问题