Hi I have developed app for iPhone4 now I want to convert the app into iPhone5, I have a UIView named settingsView it is popped up by click of a UIButton. I wanted to know how to adjust the height of the settingsView for iPhone5 .
-(IBAction)settingsButtonChanged:(UIButton *)sender
{
UIImageView *settingsImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"settingsViewImage.png"]];
settingsImage.frame = CGRectMake(25.0, 40.0, 280.0, 370.0);
settingsView.frame = CGRectMake(0.0, 20.0, 280.0, 370.0);
settingsView.backgroundColor = [UIColor clearColor];
[settingsView addSubview:settingsImage];
}
If you use the new autolayout system, you can set constraints that will automatically adjust your view's layout to take advantage of the screen size. For example, if you have several elements near the top of the view, a table in the middle, and some buttons near the bottom, you can add constraints that:
You can do the math and make the adjustments yourself, but the whole point of the autolayout system is that you don't have to bother -- let the view do it for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With