A static UITabelView solution ---- CTStaticTableView, ios static tableview

Source: Internet
Author: User

A static UITabelView solution ---- CTStaticTableView, ios static tableview
CTStaticTableView

This is a method of encapsulating static TableView with code.

You can use xib to initialize CTStaticTableView, or use the code:

    self.tableView = [[CTStaticTableView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];    [self.view addSubview:self.tableView];

Then you can synthesize your static table view cell.
Two parameters are required: one is the TableViewCell object and the other is its height.

    CTStaticTableViewCell *fristStaticCell = [CTStaticTableViewCell staticTableViewCellWithCell:[DemoTableViewFristCell fristCell] height:50];    CTStaticTableViewCell *secendStaticCell = [CTStaticTableViewCell staticTableViewCellWithCell:[DemoTableViewSecendCell secendCell] height:80];

Join up

[Self. tableView showStaticCells: @ [fristStaticCell, secendStaticCell]; // or [self. tableView showStaticCells: @ [fristStaticCell, secendStaticCell] withDidSelectRowDelegate: self]; // or [self. tableView showStaticCells: @ [fristStaticCell, secendStaticCell] withDidSelectRowBlock: ^ (NSIndexPath * indexPath) {NSLog (@ "taptaptaptap");}];

No. Check the demo code.

Https://github.com/chentoo/CTStaticTableView

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.