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

为什么不提供widthEqualToView和heightEqualToView的方法 #277

Open Rochang opened 6 years ago

Rochang commented 6 years ago

Demo -- 0中

  self.view4.sd_layout
    .leftEqualToView(self.view2)
    .topEqualToView(self.view3)
// 这两个方法的布局能加个方法吗?
    .heightRatioToView(self.view3, 1)
    .widthRatioToView(self.view2, 1);

//  这样设置无效
//    .heightIs(self.view3.height_sd)
//   .widthIs(self.view2.width_sd);

//  为什么不提供下这两个方法
//    .heightEqualToView(self.view3)
//    .widthEqualToView(self.view2);
chenjiangui commented 6 years ago

自己给sd_layout加个category不就完了