Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在iOS7中向下推导航栏_Ios7_Xcode5 - Fatal编程技术网

在iOS7中向下推导航栏

在iOS7中向下推导航栏,ios7,xcode5,Ios7,Xcode5,我正在使用iOS 6.1 SDK编译我的应用程序,并在iOS 7设备中部署。该应用程序的设备仅为iPhone设置 我有一个视图控制器,可以添加到导航控制器中 self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController: [[MyViewCo

我正在使用iOS 6.1 SDK编译我的应用程序,并在iOS 7设备中部署。该应用程序的设备仅为iPhone设置

我有一个视图控制器,可以添加到导航控制器中

self.window.rootViewController = [[UINavigationController alloc]
                                  initWithRootViewController:
                                  [[MyViewController alloc] init]];
当我在运行iOS 7的iPad Mini上部署应用程序时,顶部显示了一个奇怪的缺口


如果我将应用程序的设备设置为Universal,那么差距就会消失。有什么解释吗?谢谢。

在iOS 7中,您应该注意的几个变化:

1) iOS 7的导航栏尺寸为:-320 X 64,而iOS 6的导航栏尺寸为:-320 X 44

2) iOS 7中的导航栏半透明属性默认为“是”,因此将其设置为“否”,因为iOS 7中还包括状态栏

处理好这些事情,一切都会好起来的

//在iOS 7中以编程方式设置导航控制器和图像的示例代码

self.navigationController.navigationBar.translucent=NO;
[self.navigationController setNavigationBarHidden:NO animated:YES]; 
UIImage *backgrdNavImage=[UIImage imageNamed:@"abc.jpg"];
[self.navigationController.navigationBar setBackgroundImage:backgrdNavImage forBarMetrics:UIBarMetricsDefault];