[[UIScreen mainscreen] bounds] get the wrong size

Source: Internet
Author: User

Recently with Xcode6 Development encountered a puzzling bug,Xcode6 never met before, Apple native uiscreen get screen size is wrong, I use IPhone5 Simulator, Get to the screen size altogether is 320x480, show the effect is a black belt up and down, the controller's view is displayed in 480 height in the middle, the reason is the project settings in the launch Images source is not set (set to user Asset Catalog, which did not refer to the correct images so the size is not right) as shown: 

Workaround 1: (now create Launchimage in Images.xassets, then go to ImageSource to select)

The workaround is to create launchimage in Images.xcassets and make it launch Images source (click on Use Asset Catalog, select Imges Source, The premise is to create the launchimage in images.xcassets so that the launchimage you create is detected in images source)

Workaround 2: (Click Use Asset Catalog and then click Migrate to automatically generate a launchimage in image.xassets and then go to Images.xcassets to set the picture)

If you have launchimage in your images.xcassets, it will have a drop-down box for you to choose Launchimage or don ' t use asset catalog). If not, it will pop up as shown in the interface,

Then select migrate, and you will see that the images.xcassets automatically generates a launchimage, as shown in the following:

ImageSource Set Success Flag:

[[UIScreen mainscreen] bounds] get the wrong size

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.