在xcode5中添加UITabBarController或者UINavigationController出现下移20px
时间:2014-02-26 04:03:23
收藏:0
阅读:279
问题:
我在xcode5中开发程序,系统要求为ios6以上,在ios6系统的设备上运行程序会出现下面的问题:
其中在UIViewController中添加了UITabBarController,UITabBarController每个tab中添加了一个UINavigationController,问题是UITabBarController会下移20个像素。
原因:一般UITabBarController应该添加到window上,如果添加到UIViewController中的View上,它会自动留出20px。
解决方法代码如下:
UITabBarController *tabc=[[UITabBarController alloc] init];
[tabc.view setFrame: [self.view bounds]];
红色字体为重点。
这样问题就解决了。嘿嘿~
原文:http://blog.csdn.net/chchong1234/article/details/19909561
评论(0)