How can I set the UIView at the bottom of the screen?

I am developing an application with auto-layout disabled and the default setting for Iphone 5. Now I have a UIView at the bottom of the screen, when I switch between size options in IB, the UIView moves up correctly to fix itself at the bottom of the screen. However, despite the fact that I am testing my IPhone 4 or simulator, it does not move up, instead it turns off.

How can I make the UIView at the bottom of the application shunt up for a smaller iPhone 4?

See the following example.

Basically, I want the white box to be shunted up to fill the gap under the gray box.

Update

, , , UIView ( ) . , UIView.

+5
5

Y, , (, ) UIView, . :

float y = [UIScreen mainScreen].bounds.size.height - [UIApplication sharedApplication].statusBarFrame.size.height - myView.frame.size.height;
[myView setFrame:CGRectMake(0, y, myView.frame.size.width, myView.frame.size.height)];

... 2013... UITableViewController , , .

UIView ?

, -.

+7

( ), - ...

enter image description here

.

, , . -. 4- , , , 3,5- . , ( b/c 4- , ?)... , , .

+3

AutoLayout, , . , . autoresizingMask. autoresizingMask/

UIView *view = [[UIView alloc] init];
[view setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin];
+2

- , β†’ Pin β†’ Bottom Space SuperView. , .

+1

@Joel, iOS 7 statusBar.

float y = [UIScreen mainScreen].bounds.size.height - myView.frame.size.height;
[myView setFrame:CGRectMake(0, y, myView.frame.size.width, myView.frame.size.height)];
+1

All Articles