iOS screen, status bar (statusbar), program window size gain and screen rotation size change

Source: Internet
Author: User

App size, remove status bar

CGRect r = [UIScreen mainscreen].applicationframe;

This size does not swap wide with the screen rotation, but when the screen rotates, the height of the status bar will be automatically modified to remove the high.

Vertical screen (4 inch): X=0, Y=20, width=320, height=548

Horizontal screen (4 inch): X=0,y=0, width=300, height=568

Screen size

CGRect rx = [UIScreen mainscreen].bounds;

(4 inch) rx=x=0, y=0, width=320, height=568

Fixed size, does not change with screen rotation

Status bar Size

CGRect rect;
rect = [[UIApplication sharedapplication] statusbarframe];

Always vertical to height.

Vertical screen (4 inch): X=0, Y=0, width=320, height=20

Horizontal screen (4 inch): x=300, Y=0, width=20, height=568


How to get screen resolution in iphone


CGRect rect = [[UIScreen mainscreen] bounds];
Cgsize size = rect.size;
CGFloat width = size.width;
CGFloat height = size.height;

Also, when designing the UI, pay attention to the user's smallest touch area. There are 2 ways to say

44*44 seems to be from the SDK.

64*64 from Standford Handouts

iOS screen, status bar (statusbar), program window size gain and screen rotation size change

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.