IOS 11 and IPhone x fit those things

Source: Internet
Author: User

Preface

September 20, formally push the official version of Xcode 9 and iOS 11, the adaptation of iOS 11 is the first to adapt, many online tutorials, not repeat. The main point here is that the adaptation of the iphone x to the big God level can not be seen, I am speaking here is mainly the basic adaptation work

Summary

Start diagram: 1125 * 2436
StatusBar Height: 44
Tabbar Height: 83

    • Start the application

For some older projects, on the start-up diagram, there may be no adaptation of Xib or SB, so one may appear so that the entire project will not fit perfectly.


! [Upload login2_194373.png. . ]

Workaround, configure the start-up diagram directly with Launchscreen.xib or Launchscreen.storyboard in the project settings so that the project will show the full


iPhone X launchimage.png


iPhone X launchimage2.png
Login2.png
    • TableView-> Mjrefresh

There is a drop-down refresh of the tail, the problem is well resolved, in the document is clearly marked

 1  @property (nonatomic,assign) BOOL automaticallyadjustsscrollviewinsets Api_deprecated_with_replacement ( " use Uiscrollview ' s contentinsetadjustmentbehavior instead   ", iOS (7.0 , 11.0 ), tvOS (7.0 , 11.0 )); //  Defaults to YES  
contentInsetAdjustmentBehaviorIt 's a strange face for us now. This is an enumerated property that is defined in iOS11 for the ScrollView new one.
Note that the properties of the automaticallyAdjustsScrollViewInsets English controller are discussed above.
1 typedef ns_enum (Nsinteger, uiscrollviewcontentinsetadjustmentbehavior) {2Uiscrollviewcontentinsetadjustmentautomatic,//Similar to. scrollableaxes, but for backward compatibility would also adjust the top & bottom contentinset when th E Scroll view is owned by a view controller with automaticallyadjustsscrollviewinsets = YES inside a navigation controller , regardless of whether the scroll view is scrollable3Uiscrollviewcontentinsetadjustmentscrollableaxes,//Edges for scrollable axes is adjusted (i.e., Contentsize.width/height > Frame.size.width/height or Alwaysbounceho rizontal/vertical = YES)4Uiscrollviewcontentinsetadjustmentnever,//Contentinset is not adjusted5Uiscrollviewcontentinsetadjustmentalways,//Contentinset is all adjusted by the scroll view ' s safeareainsets6} api_available (iOS (11.0), tvOS (11.0));

in estimatedXXHeight IOS 11 By default 0 becomes now the default .AutomaticDimension , resulting in a high-level calculation error, and the resulting phenomenon is UI confusion TableView when loading more a series of questions such as the height of the view exception.

1    if(@available (IOS11.0, *)) {2_newtableview.contentinsetadjustmentbehavior =Uiscrollviewcontentinsetadjustmentnever;3         //The following is a problem with the TableView height calculation4_newtableview.estimatedrowheight =0;5_newtableview.estimatedsectionheaderheight=0;6_newtableview.estimatedsectionfooterheight=0;7         8}Else{9Self.automaticallyadjustsscrollviewinsets =NO;Ten}

IOS Navigationbar new features

NavigationIntegrationUISearchController
Put your UISearchController assign a value to navigationItem , you can implement the UISearchController integration into Navigation .

1 navigationitem.searchcontroller  //iOS 11 new attribute 2// determines whether to hide the search box when sliding; IOS 11 new Properties

@property (Nonatomic, retain, nullable) Uisearchcontroller *searchcontroller api_available (iOS (11.0)) Api_ Unavailable (tvOS);

Summary:

IOS11 system change is still relatively large, some places need to pay attention to the adaptation, otherwise there will be very strange phenomenon. For the time being, there are so many pits in iOS11 that we will continue to share them later.
The first time to write an article, thanks for your attention

Reference:

What developers need to know about iOS SDK new features
IOS 11 navigation Bar Height Customization
IOS One uikitの slew more points

Original address: Http://www.jianshu.com/p/fed93b411eb6

IOS 11 and IPhone x fit those things

Related Article

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.