IOS UITableView uicollectionview Cell Height Adaptive

Source: Internet
Author: User

1.tableviewcell Height Adaptive

Main methods:

Calculate cell height [cell.contentview systemlayoutsizefittingsize:uilayoutfittingcompressedsize];

      //  nslayoutconstraint using conditions to add relative constraints

iOS 7.0 cell height calculation modification:

-(CGFloat) TableView: (UITableView) TableView Estimatedheightforrowatindexpath: (Nsindexpath) Indexpath. Setting Cell height Valuations

-(CGFloat) TableView: (UITableView) TableView Heightforrowatindexpath: (nsindexpath) indexpath calculate cell display Height

After iOS7, the official modification prevents all cell heights from being loaded when loading large amounts of data before loading the data.

A return value of +1 is required to calculate the height.

2.uicollectioncell Height Adaptive

Main methods:

Calculate cell height [cell systemlayoutsizefittingsize:uilayoutfittingcompressedsize];

nslayoutconstraint using conditions to add relative constraints

  

IOS UITableView uicollectionview Cell height adaptive

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.