Views
ScrollView滚动到顶部
可以使用tyicoe
View的属性
View的绘制过程
B: * 1. Draw the background
S:* 2. If necessary, save the canvas' layers to prepare for fading
C:* 3. Draw view's content //onDraw
C:* 4. Draw children//dispatchDraw
R:* 5. If necessary, draw the fading edges and restore layers
D:* 6. Draw decorations (scrollbars for instance)
- parent.draw
- parent.onDraw
- parent.dispatchDraw
- child.dispatchDraw
Canvas总结
View的measure过程
- measure(widthSpec, heightSpec)
- onMeasure
- Measure的mode
- AT_MOST
- EXACTLY
- UNSPECIFIED
- 通过
MeasureSpec.getMode
获得
View的layout
过程
- generateLayoutParams
- checkLayoutParams
横竖屏切换View的改变
- 有这句话:
android:configChanges="orientation|screenSize|keyboardHidden"
,横竖屏切换不会重新调用生命周期
自定义View
TransformationInfo