在 iOS 7(4 英寸视网膜显示屏)上运行应用程序时显示黑条 [英] Black bars showing when running app on iOS 7 (4 inch retina display)

查看:31
本文介绍了在 iOS 7(4 英寸视网膜显示屏)上运行应用程序时显示黑条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个 iPod 应用程序,使用基本的 SDK 作为 5.1.应用程序有一个带有三个标签的 tabBarController,每个标签都有一个 UIViewController 来加载不同的视图.

该应用程序适用于 iOS 6.1iOS 7(3.5 英寸显示屏)模拟器和设备,但是当我们在iOS 7(4 英寸显示模拟器)或设备,我们在所有三个选项卡的视图屏幕顶部和底部都出现黑条.如果有人可以提出这个问题的原因或解决这个问题的一些可行的解决方案,那对我们真的很有帮助.

谢谢

解决方案

首先,您必须为 4 英寸屏幕显示添加所需的默认图像.检查在您的项目中正确地具有名称为 Default-568h@2x.png (640 × 1136 像素)

的图像

Default-568h@2x.png 是 4 英寸屏幕显示中的支持应用所必需的

您将此图像添加到您的工作项目中的人,从设备或模拟器中删除旧版本,清除项目并重新构建并检查希望您的问题会解决.

-

修复黑条问题后,您可以像我的回答一样检查设备给这里检查:-

检测设备类型>

如果你不能使用AutoLayout

,你有两个选择

第一

使用宏创建两个具有相同类的 xib 一个用于 3.5 英寸屏幕,一个用于 4 英寸屏幕设置,并检查出现哪个屏幕.

第二

使用宏设置Self.view框架并检查出现哪个屏幕.

您还可以使用其他方法来设置 self.view 框架,如使用 window 框架或 UIScreen

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.

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.

Thanks

解决方案

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)

This Default-568h@2x.png is Necessary for Support app in 4 inch Screen display

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.

Edit:-

After fix the black Bar issue you can check the device like my answer Give here check this:-

Detect device type

you have two choice if you can't use AutoLayout

First

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.

Second

Set Self.view frame using macro with checking which screen appear.

There are also other methods you can use for set self.view frame as using window frame or UIScreen

这篇关于在 iOS 7(4 英寸视网膜显示屏)上运行应用程序时显示黑条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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