youngsoft / TangramKit

TangramKit is a powerful iOS UI framework implemented by Swift. It integrates the functions with Android layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,LayoutSizeClass to build your App 自动布局 UIView UITableView UICollectionView
MIT License
1.21k stars 175 forks source link

button, label默认不是自适应的 #24

Closed czwpro closed 6 years ago

czwpro commented 6 years ago

我的理想状态是不用写.wrap

    descLabel.tg_top.equal(titleLabel.tg_bottom, offset: 5)
    descLabel.tg_centerX.equal(rootLayout.tg_centerX, offset: 0)
    descLabel.tg_height ~= .wrap
    descLabel.tg_width ~= .wrap

    remindButton.tg_bottom.equal(rootLayout.tg_bottom, offset: 20)
    remindButton.tg_right.equal(rootLayout.tg_right, offset: 10)
    remindButton.tg_width ~= .wrap
    remindButton.tg_height ~= .wrap
youngsoft commented 6 years ago

理想很丰满,现实很骨感, 可能你觉得默认label, button是自适应的,但是其他人也许会觉得不用自适应,因为你可以通过frame来设置label和button的宽高,所以如果我默认就自适应的话,那么其他同学就会觉得莫名其妙的被改变了。所以最终的方案是默认不自适应。

czwpro commented 6 years ago

好的