3

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+

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Sulaiman Majeed
  • 501
  • 2
  • 7
  • 21
  • you can optionally look into disabling `Autolayout` and using the iOS6/7 delta values option. link - http://www.techrepublic.com/blog/software-engineer/update-your-ios-app-to-support-ios-7/ – staticVoidMan Dec 12 '13 at 19:13
  • I was considering this, but I need to use auto layout. It is a lot easier to use this and have it automatically resize for the iPad mini. There must be a way to resize a container view. However, I have not yet been able to find a way that works. – Sulaiman Majeed Dec 12 '13 at 19:38
  • then this... maybe - http://stackoverflow.com/questions/18980925/status-bar-and-navigation-bar-issue-in-ios7 – staticVoidMan Dec 12 '13 at 19:40

0 Answers0