View controller is not showing on whole screen for

2019-06-05 02:52发布

Strange bug i am getting right now : If i am disabling auto-layout in application and trying to handle with launch screen then strange bug is coming :

Step 1 :

  • If i am setting application for iOS-7 and above only for LaunchImage then everything is working fine . But problem is that we can not set LaunchImage screen for iPhone- 6 and iPhone 6 + (In this case 1136 size image will show as splash of iPhone 6 and iPhone 6+)
  • And window size of iPhone 5 and above is showing 320*568 (for iPhone5 . 5s , 6 and 6+) .

Step 2 :

  • If i am enabling application for iOS-8 and above too for LaunchImage and setting splash for iPhone 6 and 6+ too then splash is working fine . But after splash window size will be change now its showing as per device screen size . Due to this all view controller are not showing in whole screen because view controller size is still showing 320*480

can anyone let me know why this strange problem appearing and also relevant solution for this .

Same problem appearing in swift programing too .

3条回答
老娘就宠你
2楼-- · 2019-06-05 03:13

Finally i have found one alternate solution for this problem :

Just add Launch screen for 7.0 and above then your App will run on iPhone 5,5s , 6 and 6+ accordingly .

Launchscreen

Add both LaunchImage for 2x and Retina . enter image description here

查看更多
▲ chillily
3楼-- · 2019-06-05 03:20

I think are you Forget to adding splash screen Default-568h@2x.png in to your Project and can you check my previous answer

查看更多
狗以群分
4楼-- · 2019-06-05 03:34

It is not a strange problem. Just set background color of your view in veiwDidLoad like self.view.backgroundcolor = [UIColor redColor]; and you will notice your viewController is using full screen but other controls are not getting resized.

Just use AUTO LAYOUT

Auto Layout is a system that lets you lay out your app’s user interface by creating a mathematical description of the relationships between the elements. You define these relationships in terms of constraints either on individual elements, or between sets of elements. Using Auto Layout, you can create a dynamic and versatile interface that responds appropriately to changes in screen size, device orientation, and localization.

You can check documentation

Here is the best tutorial.

UPDATE :


I WOULD NOT RECOMMEND TO USE AUTO-RESIZING

but still you want to do it without autoLayout, you must use auto-resizing.

YOU HAVE NOT ANY OTHER OPTION.

To user auto resize, use this tutorial : Handling Layout Changes Automatically Using Autoresizing Rules


Hope this will help you....

查看更多
登录 后发表回答