Note that there are some explanatory texts on larger screens.

plurals
  1. POUITabBarController - Initial Frame and Resizing
    primarykey
    data
    text
    <p>I found this: <a href="https://stackoverflow.com/questions/1815059/subclass-uitabbarcontroller-to-adjust-its-frame">Subclass UITabBarController to adjust its frame</a> which explains how to achieve what I was aiming for in the answer. To paraphrase the post there, you have to register to be notified when the TabBarController's selected view changes, and then apply your geometry there. Otherwise it gets blown away by the TabBarController. </p> <hr> <p>I am attempting to resize my UITabBarController to show a 20px high status message when certain tasks are ocurring. The curious thing is that if I step through the method which resizes the TabBarController, the origin of the frame changes. </p> <p>When the view first appears, the UITabBarController's y origin is set to 0. Even though the applicatioinScreen y.origin is 20. If I resize when the app first loads, everything is off. The subviews do not resize. After this first resize, if I view a different tab, the TabBarController adjusts itself to the proper size, and subsequent calls to my resizing method confirm this. </p> <p>This is how I am installing the UITabBarcontroller:</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UITabBarController *tabBarController = [[UITabBarController alloc] init]; [tabBarController setViewControllers:[AppController getGroupViewControllerArray] animated:NO]; [window addSubview:tabBarController.view]; [window makeKeyAndVisible]; return YES; } </code></pre> <p>And this is how I am resizing the TabBarController:</p> <pre><code>-(void)resizeTabToShowActivity { CGRect newFrame = mainTabBarController.view.frame; CGRect applicationFrame = [[UIScreen mainScreen] applicationFrame]; newFrame.origin.y = applicationFrame.origin.y + 20; newFrame.size.height = applicationFrame.size.height - 20; mainTabBarController.view.frame = newFrame; } </code></pre> <p>I have noticed that if I resize directly after installing the TabBarController in the window, everything works fine. For debugging purposes, I've moved the resize method into the AppDelegate as well, and still no joy. </p> <p>Thank you</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload