Basic use of Masonry, use of Masonry

Source: Internet
Author: User

Basic use of Masonry, use of Masonry

During the learning process, I learned about this automatic third-party framework-Masonry.

Masonry is a lightweight layout framework that uses concise code to replace lengthy and tedious AutoLayout code.

This article is only about the basic use of Masonry. For details about Masonry, refer to the following two technical blogs. I also learned about these two articles:

Introduction and use of Masonry (Quick Start With Autolayout): http://adad184.com/2014/09/28/use-masonry-to-quick-solve-autolayout/iOS source code analysis ---- Masonry: http://draveness.me/ios-yuan-dai-ma-fen-xi-masonry/

The Demo material of this article comes from what I called Sunny's great god's microblog: http://weibo.com/u/1364395395

Material post: http://blog.sunnyxx.com/2015/05/17/cell-height-calculation/

This article references the Masonry layout control when using UITableView + FDTemplateLayoutCell.

The Code is as follows:

Parse json data in this method. After parsing, return to the main thread for subsequent operations.

 

Call the above method in the viewDidLoad method and perform the corresponding operation after the method is executed.

 

LayoutSubviews of a custom cell

 

Finally, in the tableViewHeightForRowAtIndexPath method, the cell height is calculated using the UITableView + FDTemplatLayoutCell classification method.

 

This article ends. Not much content. For more information, see the Demo.

Landscape screen:

 

Portrait screen:

 

My younger brother wrote a blog for the first time. If you have any questions, please promote them more! Thank you.

Demo: https://github.com/XQBoy/MasonryExercise

 

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.