• Stars
    star
    707
  • Rank 64,036 (Top 2 %)
  • Language
    Objective-C
  • Created over 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Different Autolayout examples with Masonry. 用Masonry写的Autolayout案例,持续更新中。详细解答请看tutuge.me

Autolayout Example With Masonry

用Masonry实现的Autolayout示例。

Build Status

目录

博客

有趣的Autolayout示例-Masonry实现
讲解了Case1到Case3

有趣的Autolayout示例2-Masonry实现
讲解了Case4到Case6

有趣的Autolayout示例3-Masonry实现
讲解了Case7到Case9

有趣的Autolayout示例4-Masonry实现
讲解了Case10到Case12

有趣的Autolayout示例5-Masonry实现
讲解了Case13到Case15

Case1: 并排两个label,宽度由内容决定。父级View宽度不够时,优先显示左边label的内容

Case2: 四个ImageView整体居中,可以任意显示、隐藏

Case3: 子View的宽度始终是父级View的一半(或者任意百分比)

Case4: 动态高度UITableViewCell,附加简单的高度缓存

Case5: topLayoutGuide和bottomLayoutGuide使用案例

Case6: 自定义baseline效果

Case7: 给UITableView加上简单的Parallax视差效果Header

Case8: 实时改变UITableViewCell的高度

Case9: 等间距View

Case10: 用约束优先级保证可移动View的内容可见性

Case11: Autolayout的约束=控件间位置关系的“绑定”

Case12: 利用layoutIfNeeded控制约束的生效时机

Case13:Cell中并排多个变高Label

Case14: 自定义View的intrinsicContentSize,并支持在UITableViewCell中自动计算高度

Case15: 同一个属性可以添加多重约束

More Repositories

1

TTGTagCollectionView

Useful for showing text or custom view tags in a vertical or horizontal scrollable view and support Autolayout at the same time. It is highly customizable that most features of the text tag can be configured. 标签流显示控件,同时支持文字或自定义View
Objective-C
1,822
star
2

TTGSnackbar

TTGSnackbar shows simple message and action button on the bottom or top of the screen with multi kinds of animation, which is written in Swift3 and inspired by Snackbar in Android. It also support showing custom view, icon image or multi action button.
Swift
634
star
3

TTGPuzzleVerify

By completing image puzzle game, TTGPuzzleVerify is a more user-friendly verification tool on iOS, which is highly customizable and easy to use. 体验更友好的拼图验证控件
Objective-C
353
star
4

TTGEmojiRate

An emoji-liked rating view for iOS, implemented in Swift3.
Swift
289
star
5

TTGBingWallPaper

Mac menubar app. Automate download daily picture from Microsoft Bing website and set it as your wallpaper. Written in Swift3.
Swift
183
star
6

UITextViewDIYEmojiExample

Example of insert custom emoji image in to UITextView. And get the represent string back after editing.
Objective-C
149
star
7

HttpProxyExample

HttpProxyExample-Example of using NSProxy
Objective-C
47
star
8

iOS-Tasks

ITEC学习iOS同学的Github聚集地=。=
Objective-C
43
star
9

AutoReleasePoolTestExample

An example to figure out the benefit to use @autoreleasepool in ARC iOS program.
Objective-C
30
star
10

TTGDeallocTaskHelper

NSObject Category to add callback tasks when object dealloc.
Shell
29
star
11

LinkTextView

An Android TextView to add highly customizable and colorful link.
Java
29
star
12

ThriftDemo_PHP_CPP

Demo for Thrift RPC framework. PHP client call CPP server.
PHP
29
star
13

QuartzCodeExample-StarAimation

QuartzCode star-style animation demo.
Objective-C
27
star
14

TTGNotificationGuard

Auto remove the observer from NSNotificationCenter after the oberser dealloc
Shell
13
star
15

TTGRemakeMethodSignatureForSelector

Remake methodSignatureForSelector. Just for research. :)
Objective-C
10
star
16

OutParameterPointerCrashOnXcode8

Example code for out parameter pointer EXC_BAD_ACCESS crash on Xcode 8
C++
4
star
17

TTGKVOGuard

Auto remove KVO observer from object after it dealloc.
Objective-C
2
star
18

zekunyan.github.io

tutuge blog
HTML
1
star