在iOS 7(4英寸视网膜显示屏)上运行应用程序时显示黑条 [英] Black bars showing when running app on iOS 7 (4 inch retina display)
问题描述
我们有一个基本 SDK
构建的 iPod
应用为 5.1。
应用程序有一个 tabBarController
,带有三个选项卡,每个选项卡都有一个 UIViewController
来加载一个不同的视图。
We have an iPod
app built with base SDK
as 5.1.
App has a tabBarController
with three tabs and each tab has a UIViewController
to load a different view.
该应用适用于 iOS 6.1
和 iOS 7
(3.5英寸显示屏)模拟器和设备但是当我们在
iOS 7
(4英寸显示模拟器)或设备上运行应用程序时,我们会变黑所有三个选项卡中视图屏幕顶部和底部的条形图。
如果有人可以为这个问题提出理由或某些可行的解决方案,那对我们来说真的很有用。
The app works fine for iOS 6.1
and iOS 7
(3.5 inch display) simulator and device but when we run the app on
iOS 7
(4 inch display simulator) or device we are getting black bars at the top and bottom of the view screen in all three tabs.
If anyone can suggest reason for this or some feasible solution to this problem, it would be really helpful for us.
谢谢
推荐答案
首先,您必须为4英寸屏幕显示添加所需的默认图像。在项目中正确检查图像的名称为 Default-568h@2x.png (640×1136像素)
First thing is that you must add the required default image for 4 inch screen display. Check Properly in you project have image with name Default-568h@2x.png (640 × 1136 pixels)
此 Default-568h@2x.png 对于4英寸屏幕显示中的支持应用程序是必需的
This Default-568h@2x.png is Necessary for Support app in 4 inch Screen display
您添加的内容这个图像在你的工作项目,从设备或Simulatore删除旧的Build,清除项目并重新构建和检查希望你的问题将解决。
Ones you add this image in to you working Project, Remove old Build from device or Simulatore, clear Project and re build and check Hope you issue will solve.
编辑: -
修复黑条问题后,您可以像我的回答一样查看设备。点击此处查看: -
After fix the black Bar issue you can check the device like my answer Give here check this:-
如果你不能使用 AutoLayout
首先
为3.5英寸屏幕创建两个 xib
相同的第一类和一个4英寸的屏幕设置使用宏,检查哪个scr出现。
Create two xib
with same class one for 3.5 inch screen and one for 4 inch screen set using macro with checking which screen appear.
第二
设置自我。查看
框架使用宏并检查出现哪个屏幕。
Set Self.view
frame using macro with checking which screen appear.
还可以使用其他方法将set self.view框架用作 window
frame或 UIScreen
There are also other methods you can use for set self.view frame as using window
frame or UIScreen
这篇关于在iOS 7(4英寸视网膜显示屏)上运行应用程序时显示黑条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!