{"id":21031856,"url":"https://github.com/zekunyan/autolayoutexamplewithmasonry","last_synced_at":"2025-04-04T22:06:12.639Z","repository":{"id":32540149,"uuid":"36122101","full_name":"zekunyan/AutolayoutExampleWithMasonry","owner":"zekunyan","description":"Different Autolayout examples with Masonry.  用Masonry写的Autolayout案例，持续更新中。详细解答请看tutuge.me","archived":false,"fork":false,"pushed_at":"2018-05-08T06:37:30.000Z","size":1128,"stargazers_count":704,"open_issues_count":1,"forks_count":146,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-03-28T21:06:01.567Z","etag":null,"topics":["animation","autolayout","demo","ios","objective-c","uitableviewcell"],"latest_commit_sha":null,"homepage":"http://tutuge.me","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zekunyan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-23T12:24:17.000Z","updated_at":"2025-03-11T13:10:29.000Z","dependencies_parsed_at":"2022-09-15T05:11:00.104Z","dependency_job_id":null,"html_url":"https://github.com/zekunyan/AutolayoutExampleWithMasonry","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekunyan%2FAutolayoutExampleWithMasonry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekunyan%2FAutolayoutExampleWithMasonry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekunyan%2FAutolayoutExampleWithMasonry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekunyan%2FAutolayoutExampleWithMasonry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zekunyan","download_url":"https://codeload.github.com/zekunyan/AutolayoutExampleWithMasonry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256112,"owners_count":20909240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animation","autolayout","demo","ios","objective-c","uitableviewcell"],"created_at":"2024-11-19T12:33:07.566Z","updated_at":"2025-04-04T22:06:12.620Z","avatar_url":"https://github.com/zekunyan.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Autolayout Example With Masonry\n用Masonry实现的Autolayout示例。\n\n[![Build Status](https://travis-ci.org/zekunyan/AutolayoutExampleWithMasonry.svg?branch=master)](https://travis-ci.org/zekunyan/AutolayoutExampleWithMasonry)\n\n![目录](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/demo_screenshot.png)\n\n## 博客\n[有趣的Autolayout示例-Masonry实现](http://tutuge.me/2015/05/23/autolayout-example-with-masonry/)  \n讲解了Case1到Case3\n\n[有趣的Autolayout示例2-Masonry实现](http://tutuge.me/2015/08/08/autolayout-example-with-masonry2/)  \n讲解了Case4到Case6\n\n[有趣的Autolayout示例3-Masonry实现](http://tutuge.me/2015/12/14/autolayout-example-with-masonry3/)  \n讲解了Case7到Case9\n\n[有趣的Autolayout示例4-Masonry实现](http://tutuge.me/2016/08/06/autolayout-example-with-masonry4/)  \n讲解了Case10到Case12\n\n[有趣的Autolayout示例5-Masonry实现](http://tutuge.me/2017/03/12/autolayout-example-with-masonry5/)  \n讲解了Case13到Case15\n\n### Case1: 并排两个label，宽度由内容决定。父级View宽度不够时，优先显示左边label的内容\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case1.png)\n\n### Case2: 四个ImageView整体居中，可以任意显示、隐藏\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case2.png)\n\n### Case3: 子View的宽度始终是父级View的一半（或者任意百分比）\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case3.png)\n\n### Case4: 动态高度UITableViewCell，附加简单的高度缓存\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case4.png)\n\n### Case5: topLayoutGuide和bottomLayoutGuide使用案例\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case5.png)\n\n### Case6: 自定义baseline效果\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case6.png)\n\n### Case7: 给UITableView加上简单的Parallax视差效果Header\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case7.png)\n\n### Case8: 实时改变UITableViewCell的高度\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case8.png)\n\n### Case9: 等间距View\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case9.png)\n\n### Case10: 用约束优先级保证可移动View的内容可见性\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case10.png)\n\n### Case11: Autolayout的约束=控件间位置关系的“绑定”\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case11.png)\n\n### Case12: 利用`layoutIfNeeded`控制约束的生效时机\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case12.png)\n\n### Case13：Cell中并排多个变高Label\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case13.png)\n\n### Case14: 自定义View的intrinsicContentSize，并支持在UITableViewCell中自动计算高度\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case14.png)\n\n### Case15: 同一个属性可以添加多重约束\n\n![](https://github.com/zekunyan/AutolayoutExampleWithMasonry/raw/master/Resources/case15.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzekunyan%2Fautolayoutexamplewithmasonry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzekunyan%2Fautolayoutexamplewithmasonry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzekunyan%2Fautolayoutexamplewithmasonry/lists"}