layout subviews

141 阅读1分钟

setneedslayout -> flag layout 需要改变 -> layoutifneed (立即改变) ->layoutsubviews

会重新布局子View

-----自动触发--------

bounds frame (position resize) addsubview

旋转 rotating

uiscrollow ( self and superview)

updateconstraint


text color image coregraph drawing

setneedsdisplay -> flag 需要重新draw -> 一般无需立即改变 -> draw rect

不会重写子View


setneedsupdateconstraint -> flag 需要更新 constraint -> updateconstraintifneed (立即改变) -> updateconstraints

active/deactive constraint

update constraint value priority

removefromsuperview

tech.gc.com/demystifyin…


viewcontroller生命周期

instance

loadView
viewdidLoad viewwillappear viewwilllayoutsubview viewdidlayoutsubview viewdidappear viewwilldisappear viewdiddisappear

dealloc