单一view顺序为:

  init构造函数 -- onFinishInflate -- onMeasure -- onSizeChanged -- onLayout -- onDraw

子类和父类顺序为:

父类init构造函数 -- 子类init构造函数 -- 子类onFinishInflate -- 父类onFinishInflate --

子类onMeasure --父类onMeasure -- 父类onSizeChanged -- 子类onSizeChanged --

子类onLayout -- 父类onLayout -- 父类onDraw -- 子类onDraw

整体顺序为:父-子-子-父 这样来回循环。

从下方可以看出onLayout false时亦为onSizeChanged 未调用时。该参数为onLayout 第一个参数 changed。

 

由于手机禁了Log.d 的输出,暂用System.out来代替,也可以用Log.e或Log.w等较高级别的日志来输出。

08-22 14:55:00.507 10266-10266/com.milog.test.mytest I/System.out: MiloDialog 08-22 14:55:00.519 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView 08-22 14:55:00.520 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView onFinishInflate08-22 14:55:00.527 10266-10266/com.milog.test.mytest I/System.out: MiloDialog onFinishInflate08-22 14:55:00.552 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView onMeasure08-22 14:55:00.553 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView onMeasure08-22 14:55:00.554 10266-10266/com.milog.test.mytest I/System.out: MiloDialog onMeasure08-22 14:55:00.564 10266-10290/com.milog.test.mytest I/ViewRootImpl: W::resized  reportDraw:true  frame:Rect(60, 774 - 1020, 1220)  newConfig:null08-22 14:55:00.574 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView onMeasure08-22 14:55:00.575 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView onMeasure08-22 14:55:00.575 10266-10266/com.milog.test.mytest I/System.out: MiloDialog onMeasure08-22 14:55:00.576 10266-10266/com.milog.test.mytest I/System.out: MiloDialog onSizeChanged08-22 14:55:00.576 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView onSizeChanged08-22 14:55:00.576 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView onLayout true08-22 14:55:00.576 10266-10266/com.milog.test.mytest I/System.out: MiloDialog onLayout true08-22 14:55:00.583 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView onMeasure08-22 14:55:00.584 10266-10266/com.milog.test.mytest I/System.out: MiloDialog onMeasure08-22 14:55:00.596 10266-10290/com.milog.test.mytest I/ViewRootImpl: W::resized  reportDraw:true  frame:Rect(108, 774 - 972, 1220)  newConfig:null08-22 14:55:00.603 10266-10266/com.milog.test.mytest I/System.out: MiloDialog onSizeChanged08-22 14:55:00.603 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView onSizeChanged08-22 14:55:00.603 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView onLayout true08-22 14:55:00.603 10266-10266/com.milog.test.mytest I/System.out: MiloDialog onLayout true08-22 14:55:00.604 10266-10266/com.milog.test.mytest I/System.out: MiloDialog onDraw08-22 14:55:00.604 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView onDraw08-22 14:55:00.629 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView onMeasure08-22 14:55:00.630 10266-10266/com.milog.test.mytest I/System.out: MiloDialog onMeasure08-22 14:55:00.630 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView onLayout false08-22 14:55:00.630 10266-10266/com.milog.test.mytest I/System.out: MiloDialog onLayout false08-22 14:55:01.763 10266-10266/com.milog.test.mytest I/System.out: MiloDialog onDraw08-22 14:55:01.764 10266-10266/com.milog.test.mytest I/System.out: TypeSetTextView onDraw

 

更多相关文章

  1. C语言函数的递归(上)
  2. Android(安卓)NDK之二:创建NativeActivity
  3. Android(安卓)获取验证码倒计时实现
  4. [置顶] Android(安卓)IPC 通讯机制源码分析【下】
  5. Android用户界面
  6. android4.4.2 bluetooth解析(二)
  7. Android(安卓)NDK学习笔记11-JNI异常处理
  8. Android(安卓)Zygote进程源码分析
  9. android上的漏洞挖掘方式和Fuzz

随机推荐

  1. 2019最新《Android开发全套学习教程》
  2. android重新签名APK文件
  3. 论Android Binder驱动在Framework中的重
  4. 关于Android(安卓)O 通知渠道总结
  5. android 查询电话号码,对中文进行排序[a-z
  6. unity在android真机上的调试
  7. Android特色开发(1):传感器
  8. Android 7.0 给开发者带来了什么
  9. Android处理大图片
  10. VMware安装Android