Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone 5 TabBar not functioning in proper position

I am updating our app and I have added the new default image but my tab bar was not working on the iPhone 5. I did some research and created an if statement checking for the size of the display and then placing the tab bar in the proper location. The problem is that when the if statement hits the iPhone 5 screen size and places the tab bar in the right place, the buttons do not work... If I change the vertical location to a lesser value the buttons then work. Here is the code:

UITabBar *tabBar = self.tabBarController.tabBar;

if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
    CGSize result = [[UIScreen mainScreen] bounds].size;
    if(result.height == 480)
    {
        tabBar.frame=CGRectMake(0,431,320,49);
    }
    if(result.height == 568)
    {
        tabBar.frame=CGRectMake(0,519,320,49);
    }
}

Now if I change the "519" vertical alignment to "450" the tab bar is higher up on the screen but the buttons do work. Any ideas -- it's driving me nuts! It's the last thing I need to get working for me to launch my update.

like image 917
Mat Avatar asked Sep 24 '12 16:09

Mat


1 Answers

If your window is being created in an older nib there is most likely a checkbox that needs to be checked on the windows attributes titled "full screen at launch"

More info here.

like image 100
Anthony Avatar answered Sep 23 '22 03:09

Anthony