简体   繁体   中英

iPad app screen dimensions

I built an iPad app.I do not want to use AutoLayout.I would like to handle position of UIElements according to view size.

I try to take screen dimensions with this code:

CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat screenWidth = screenRect.size.width;
CGFloat screenHeight = screenRect.size.height;

But when i test the app on iPad simulator and iPad Retina simulator i always get the same result and some of UIElements disappear. I want to take screen dimensions to position my elements in the right point.But i do not get different bounds for iPad and iPad Retina simulators.

In iPhone app i got screen dimensions and i check if height is equals to 480 or not and i handle position of my elements.

In iPad how can i do this?

iPad and iPad retina have different resolutions. But their physical screen size is the same. Thats the reason why you get the same value for both.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM