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

在Controller中合适才可以拿到准确的frame? #40

Closed birdmichael closed 5 years ago

birdmichael commented 5 years ago

我是按照demo,view放在loadView写的。并且修改了self.view 我需要添加一个CAShapeLayer,所以需要知道子控件尺寸。 我在viewDidLayoutSubviews下拿到的通过wrap的高度为0. 请问这种情况在正常生命周期下,应该在哪里才可以获取所有控件的正确frame呢?

birdmichael commented 5 years ago

tg_layoutCompletedDo 和tg_endLayoutDo

birdmichael commented 4 years ago

因为通过wrap,所以需要子控件布局。所以最终使用tg_endLayoutDo