iOS TableView swipe to the bottom

Source: Internet
Author: User

TableView sliding to the bottom, depending on the page can be two ways

The first type: The general style of the tableview without head and tail

#pragmaMark-Slide to the bottom-(void) Scrolltabletofoot: (BOOL) Animated {Nsinteger s= [Self.tableview numberofsections];//How many groups are there?if(s<1)return;//No data is not executed to not crashNsinteger r = [Self.tableview numberofrowsinsection:s-1];//How many rows are in the last groupif(r<1)return; Nsindexpath *ip = [Nsindexpath indexpathforrow:r-1insection:s-1];//take the last row of data[Self.tableview Scrolltorowatindexpath:ip Atscrollposition:uitableviewscrollpositionbottom animated:animated];//Scroll to the last line}

The second kind: with Tablefooterview, if the first sliding, can only slide to the last line, not sliding to the bottom should use the following

-(void) Scrollviewtobottom: (BOOL) animated{    if>  Self.tableView.frame.size.height) {
=Cgpointmake (0-self.tableView.frame.size.height); [Self.tableview Setcontentoffset:offset animated:animated];
}}

iOS TableView swipe to the bottom

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.