IPhone development and learning, iPhone 5 page adaptation and Modification

Source: Internet
Author: User

1. You need to add a boot image with the size: 640*1136. After the image is created, the name is default-568h@2x.png. InCodeDetermine iPhone 5? (Image-1) :( image-1-os5), no such as @ 22x.

 
# DefineIphone5 ([uiscreen instancesrespondtoselector: @ selector (currentmode)]? Cgsizeequaltosize (cgsizemake (640,113 6), [[uiscreen mainscreen] currentmode]. Size): No)

2. for iPhone 5, the view is 568, minus NAV (44) + taskbar (20), which is 504. Compared with iPhone 4S and earlier versions of 480, the view is 416, 88 higher (difference ).

3. Code modification:

(1) In iPhone 5, the values to be modified are Y and height, depending on the specific difference. Modify the view's height:

 
View. Frame = cgrectmake (0,0,320,416+ (Iphone5?88:0))

Y modification is similar.

(2) controller initialization:

 
Aviewcontroller * aviewcontrller = [[aviewcontroller alloc] initwithnibname :( iphone5?@"AViewController-5":@"Aviewcontroller") Bundle: Nil];

4. Modify XIB:

(1). View, tableview, and other interfaces, directly modify the autosizing attribute to stretch it up and down.

(2 ). some views that cannot be modified (such as adding 2 fixed-size views in the view), you need to create a new XIB file (assuming the AController-5.xib ), add the view and set the size to retina 4 full screen in simulated metrics, and then relay the Screen Based on the fixed position, and then use Part 2 (2 ).

 

5. Other parts:

1. If you want to change the background of the uitableview default group table to white, remove backgroundview.

2. Rotate the X of the cgrect to be modified.

3. passbook introduction.

4. simulator home shortcut: Shift + command + H.

5. to be supplemented.

6. Use the push of NAV to open some floating filter items to avoid changing the 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.