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

为什么我的widthRatioToView,heightRatioToView完全没用? #274

Open hms111111 opened 6 years ago

hms111111 commented 6 years ago

imageV.sd_layout.topSpaceToView(self, 0) .leftEqualToView(self) .widthIs(Main_Screen_Width) .heightIs(HEIGHT(self)*3/4);

    BTNView.sd_layout.topSpaceToView(imageV, 0)
    .leftSpaceToView(imageV, 0)
    .widthRatioToView(imageV, 1)
    .heightRatioToView(imageV, 1/3);

(lldb) po imageV <UIImageView: 0x7fbdfb4c5870; frame = (0 0; 320 112.5); userInteractionEnabled = NO; layer = <CALayer: 0x7fbdfb4c5970>>

(lldb) po BTNView <UIView: 0x7fbdfb4c5f40; frame = (0 0; 0 0); layer = <CALayer: 0x7fbdfb4c5b10>>