After iOS 11 is updated and iPhone X is released, problems encountered in the project and adaptation, iosiphone

Source: Internet
Author: User

After iOS 11 is updated and iPhone X is released, problems encountered in the project and adaptation, iosiphone

1. When the UITableView slides, the sliding bars on the right are suddenly long and short, and the endless loop is pulled and refreshed on the MJRefresh.

This is because tableView uses Self-Sizing by default in iOS11. The estimatedRowHeight, dimensions, and dimensions attributes of tableView are changed from 0 to UITableViewAutomaticDimension. KVO of MJRefresh listens for incorrect contentoffset, as a result, the upload and pull operations are not stopped,

Solution: Set the default value of the preceding three attributes to 0 in the global setting.

UITableView.appearance.estimatedRowHeight = 0;UITableView.appearance.estimatedSectionFooterHeight = 0;UITableView.appearance.estimatedSectionHeaderHeight = 0;

2. In iOS 11, the contentsize of tableview is reduced by 64 by default.

In iOS 11, the automaticallyAdjustsScrollViewInsets attribute of UIViewCOntroller is replaced by the contentInsetAdjustmentBehavior attribute of UIScrollVIew. You can also change the default value.

if (@available(iOS 11.0, *)) {    UIScrollView.appearance.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;} else {    // Fallback on earlier versions    self.automaticallyAdjustsScrollViewInsets = NO;}

However, when calling the album in this way, when the system album is released, the system page contentSize is removed, causing a major problem, so you can just remove the default value from the interface and modify it.

3. The project has a huge black edge when running on iPhone X.

Solution: Because the LaunchImage in Assets is used in the project, you can modify the LaunchImage in Assets and add the LaunchImage of the iPhone X (1125*2436),

Before iOS 11, the height of the navigation bar was 64. The height of the status bar statusBar was 20, and that of the tabbar at the bottom was 49.

After iOS 11, the height of the onex navigation bar is 88. The height of the statusBar in the status bar is changed to 44, and the tabbar at the bottom is changed to 83.

The Virtual Home area is added at the bottom of the iPhoneX. The height of the tabBar is changed from 49 to 83 by default due to the security zone, and 34 is increased. Therefore, you need to modify the adaptation scheme of the customized TabBar at the bottom.

 

Author: Chu Guangfu

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.