I am trying to resize a container view's frame based on the OS type. Hence, I have implemented the following code in my viewwillappear method:
- (void)viewWillAppear:(BOOL)animated
{
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7)
{
topBar.frame = CGRectMake( 0, 0, 300, 400 ); // set new position exactly
NSLog(@"Top Bar Frame: %f, %f, %f, %f", topBar.frame.origin.x, topBar.frame.origin.y, topBar.frame.size.width, topBar.frame.size.height);
}
}
This appears to be working, since I get the following response in the console:
2013-12-12 12:19:07.830 Project1[68954:a0b] Top Bar Frame: 0.000000, 0.000000, 300.000000, 400.000000
However, my screen still displays the old view, and not the topbar with the modified frame:
https://i.stack.imgur.com/RFXvd.png
My header file has the following code implemented:
@interface ChartViewController : UIViewController <UITextFieldDelegate>
{
IBOutlet UIView *topBar;
}
My topBar is hooked up to a container view in the IB (https://i.stack.imgur.com/hmVyD.png). I want to resize the container and everything in it if the device is iOS7+