gsdios / SDAutoLayout

One line of code to implement automatic layout. 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于做最简单易用的AutoLayout库。The most easy way for autoLayout. Based on runtime.
MIT License
5.9k stars 1.28k forks source link

iOS12下这样布局的话,图片下面和文字上部分会有部分重叠,在iOS11及以下显示正常 #294

Open CLQ201010 opened 5 years ago

CLQ201010 commented 5 years ago
self.goBtn.sd_layout
.rightSpaceToView(self.contentView, 16)
.centerYEqualToView(self.contentView)
.widthIs(40)
.heightIs(50);

self.goBtn.imageView.sd_layout
.topEqualToView(self.goBtn)
.centerXEqualToView(self.goBtn)
.widthIs(25)
.heightIs(25);

self.goBtn.titleLabel.sd_layout
.leftEqualToView(self.goBtn)
.topSpaceToView(self.goBtn.imageView, 5)
.rightEqualToView(self.goBtn)
.autoHeightRatio(0);
liujunliuhong commented 5 years ago

goBtn的高度已经固定了,imageView高度为25,但是titleLabel是高度自适应,如果文字过多,就会出现重叠,应该把.autoHeightRatio(0)改为.bottomEqualToView(self.goBtn)