IOS One Uiscrollview offset

Source: Internet
Author: User
First, translucent
/*
 New behavior on IOS 7.
 The Default is YES.
 You may force a opaque background by setting.
 If the navigation bar has a custom background image, the default is inferred from the 
 alpha values of the Image-yes if It has any pixel with Alpha < 1.0
 If your send settranslucent:yes to a bar with a opaque custom background 7/>it'll apply a system opacity less than 1.0 to the image.
 If you send Settranslucent:no to a bar with a translucent custom background image
 It'll provide an opaque background For the image using the "bar" bartintcolor if defined, or black for
 uibarstyleblack or white for uibarstyledefault I F Bartintcolor is nil.
 * *
@property (nonatomic,assign,getter=istranslucent) BOOL translucent Ns_available_ios (3_0) Ui_appearance_ SELECTOR; Default is NO on IOS 6 and earlier. Always YES If Barstyle is set to Uibarstyleblacktranslucent

After IOS 7 This property defaults to Yes;
1. When the property is set Yes:
(1) If the first child view added is the origin of the Uiscrollview,uiscrollview (0,0), the origin of the Uiscrollview's child view begins at the (0,64) point.
(2) If you add the first child view to a Uiscrollview, the origin starts at the (0,0) point.
2, when the property is set to No:
(1) The origin of the added child view starts at the (0,64) point. Second, Automaticallyadjustsscrollviewinsets

@property (nonatomic,assign) BOOL automaticallyadjustsscrollviewinsets api_deprecated ("Use Uiscrollview ' s Contentinsetadjustmentbehavior instead ", iOS (7.0,11.0), tvOS (7.0,11.0)); Defaults to YES

This property does not work after iOS11, and between IOS7-IOS10, when the translucent property is set to No, the property has no effect and, if the translucent property is set to Yes:
1, Automaticallyadjustsscrollviewinsets set to Yes:
(1) If the first child view added is the origin of the Uiscrollview,uiscrollview (0,0), the origin of the Uiscrollview's child view begins at the (0,64) point.
(2) If you add the first child view to a Uiscrollview, the origin starts at the (0,0) point.
2, Automaticallyadjustsscrollviewinsets set to No:
(1) The origin of the added child view starts at the (0,0) point. Third, Edgesforextendedlayout

@property (nonatomic,assign) Uirectedge edgesforextendedlayout Ns_available_ios (7_0); Defaults to Uirectedgeall

The enumeration follows several values:

typedef ns_options (Nsuinteger, Uirectedge) {
    Uirectedgenone   = 0,
    uirectedgetop    = 1 << 0,
    Uirectedgeleft   = 1 << 1,
    uirectedgebottom = 1 << 2,
    uirectedgeright  = 1 << 3,
    Uirectedgeall    = Uirectedgetop | Uirectedgeleft | Uirectedgebottom | Uirectedgeright
} ns_enum_available_ios (7_0);

This property has no effect when the translucent property is set to No.
If the translucent property is set to Yes:
1, edgesforextendedlayout setting is set to Uirectedgenone;
(1) The origin of the added child view starts at the (0,64) point.
2, edgesforextendedlayout setting is set to Uirectedgeall;
(1), follow other attributes to set the result. Four, Contentinsetadjustmentbehavior

/* Configure the behavior of Adjustedcontentinset.
 The Default is uiscrollviewcontentinsetadjustmentautomatic.
 * *
@property (nonatomic) uiscrollviewcontentinsetadjustmentbehavior Contentinsetadjustmentbehavior API_ AVAILABLE (iOS (11.0), tvOS (11.0));

In front of the iOS11, the automaticallyadjustsscrollviewinsets is no longer working, and the replacement is the property, set as follows:

if (@available (IOS 11.0, *)) {
    Self.tableview.contentInsetAdjustmentBehavior = Uiscrollviewcontentinsetadjustmentnever;
} else {
    self.automaticallyadjustsscrollviewinsets = NO;
}

Self-sizeing is added to the scrolling view on iOS11, and the default is not to invoke heightforheaderinsection if Viewforheaderinsection is not implemented.
Much of the web is about the top offset of the tableview that describes how to fit the iOS11. But I have not tried to come out, according to the online description of the problem resolved as follows:

self.tableView.estimatedRowHeight = 0;
self.tableView.estimatedSectionHeaderHeight = 0;
self.tableView.estimatedSectionFooterHeight = 0;

If a friend has tableview the top blank demo, please leave a message to me, thank you ...

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.