Clicking on the status bar in IOS UITableView cannot roll back to the top

Source: Internet
Author: User

When the user taps the status bar, the scroll view beneath the touch which are closest to the status bar would be Scrolle D to top, if it's ' Scrollstotop ' property is YES, it delegate does not return No. from ' Shouldscrollviewscrolltoto P ', and it isn't already at the top.
On the IPhone, we execute this gesture only if there's one on-screen scroll view with ' scrollstotop ' = = YES. If more than one is found, none would be scrolled.
@property (nonatomic) BOOL scrollstotop; Default is YES.


Setting this property allows the click Status bar not to return to the top, but if we need to get him back to the top, the program does not respond to the action, the workaround

Just above the official document said, only if a host controller has a ScrollView and set this property to Yes, the other scrollview.scrollstotop = NO This will respond to this event, the principle is very simple, if there are 2 ScrollView, The system doesn't know which one you need to scroll to the top.

But

There was really only one uitableview on my page, and I was wondering.

But think about it. Other controls on the page may contain ScrollView.

ScrollView TableView, CollectionView webview all contain ScrollView.

My page is the application of a UIWebView cause the click on the top status bar does not return normally.

Classic case, third-party picture scrolling use more like: Sdcyclescrollview

Once the Sdcyclescrollview is used, it goes back to the top and fails.

Workaround:

Modify the source code, when Uicollectionview *mainview is initiated, add:

// do not use this sentence, will lead to return to the top of the failure

Clicking on the status bar in IOS UITableView cannot roll back to the top

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.