General idea about Waterfall streaming in IOS

Source: Internet
Author: User

I downloaded an iOS waterfall Stream Image Display source code from the Internet. With the help of Web experience, I already have a float: Left effect for iOS similar to CSS style, and then formed a waterfall stream effect, or you can use HTML to split a table into several columns in a row and then fill in the content.

The download of the waterfall stream demo is as follows:

1. it is always necessary to know the number of records first, which can be read from JSON or XML (it is best to display the image height and width in JSON or XML, for later use ).

2. If you want to create three columns, you can use three uitableviews, with the average width and dynamic height. The page height is the highest in uitableview.

3. tags are used when three uitableviews are initialized (I increasingly think that tags are very useful in iOS, just like the IDs in HTML controls read in JS), and showsverticalscrollindicator and scrollenabled are set to No, set separatorstyle to uitableviewcellseparatorstylenone and add it to uiview.

4.

 
-(Nsinteger) tableview :( uitableview *) Tableview numberofrowsinsection :( nsinteger) Section {ReturnWhen the number of rows of records/Column ;}
-(Cgfloat) tableview :( uitableview *) tableview heightforrowatindexpath :( nsindexpath *) Indexpath {IntArrindex = Current indexpath. row * column (3) + Current indexpath. Column; |Return[[XML/JSON objectatindex: arrindex] objectforkey:@"Height"];}
 
-(Uitableviewcell *) tableview :( uitableview *) tableview cellforrowatindexpath :( nsindexpath *) Indexpath {//Obtain the data corresponding to the current array from the data source, and then fill it with uitableviewcell.}

 

Thanks to the source code Author: http://code4app.com/codesample/4fdfecd96803fa117f000000

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.