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