Skip to content

A very simple implementation of autolayout for iOS. 语法类似 masonry,但是实现极为简单。是对 iOS 原生 autolayout 的封装

Notifications You must be signed in to change notification settings

danleechina/DLSimpleAutolayout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DLSimpleAutolayout

这是语法类似 Masonry,但是实现上更为简单的 autolayout 封装。

使用方式

手动添加 DLSimpleAutolayout 到工程中。

用法

Demo 中的布局效果如下:

代码如下:

	@[
	  self.button1.dl_top.equalTo(self.view).offset(100),
	  self.button1.dl_left.equalTo(self.view).offset(10),
	  self.button1.dl_right.equalTo(self.view).offset(-10),
	  self.button1.dl_height.equalTo(@40),
	].dl_constraint_install();
	    
	@[
	  self.button2.dl_top.equalTo(self.button1.dl_bottom).offset(10),
	  self.button2.dl_left.equalTo(self.button1),
	  self.button2.dl_right.equalTo(self.button1),
	  self.button2.dl_height.equalTo(@60),
	].dl_constraint_install();

贡献者

作者: @粉碎音箱的音乐(weibo)

Blog: Blog

需要 Star!

如果你觉得 DLSimpleAutolayout 有用的话,请点个 star 呗!谢谢啦。😄

About

A very simple implementation of autolayout for iOS. 语法类似 masonry,但是实现极为简单。是对 iOS 原生 autolayout 的封装

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published