iPhone 5 TabBar无法正常工作 [英] iPhone 5 TabBar not functioning in proper position

查看:91
本文介绍了iPhone 5 TabBar无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在更新我们的应用程序,但我添加了新的默认图像,但我的标签栏无法在iPhone 5上运行。我做了一些研究并创建了一个if语句检查显示器的大小然后放置标签栏在适当的位置。问题是,当if语句达到iPhone 5的屏幕尺寸并将标签栏放在正确的位置时,按钮不起作用......如果我将垂直位置更改为较小的值,则按钮会起作用。以下是代码:

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);
    }
}

现在,如果我将519垂直对齐更改为450标签栏在屏幕上方较高,但按钮确实有效。任何想法 - 这让我疯了!这是我需要为我工作以启动更新的最后一件事。

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.

推荐答案

如果您的窗口是在较旧的时候创建的nib很可能需要在标题为启动时全屏的Windows属性上检查一个复选框

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"

更多信息这里

这篇关于iPhone 5 TabBar无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆