android,view的执行过程onDraw、onSizeChanged,onFinishInflate
Android  /  houtizong 发布于 3年前   131
12-05 22:23:03.587: D/mDebug(9715): TestView context, attrs=@213103411212-05 22:23:03.597: D/mDebug(9715): onFinishInflate12-05 22:23:03.667: D/mDebug(9715): onSizeChanged,w=240,h=282,oldw=0,oldh=012-05 22:23:03.727: D/mDebug(9715): onDraw12-05 22:23:03.757: D/mDebug(9715): onDraw
public class TestView extends View {public TestView(Context context) {super(context);Log.d("mDebug", "TestView context");}public TestView(Context context, AttributeSet attrs, int defStyle) {super(context, attrs, defStyle);Log.d("mDebug", "TestView context,attrs,defStyle attrs="+attrs.getAttributeValue(0));}public TestView(Context context, AttributeSet attrs) {super(context, attrs);Log.d("mDebug", "TestView context, attrs="+attrs.getAttributeValue(0));}@Overrideprotected void onDraw(Canvas canvas) {// TODO Auto-generated method stubsuper.onDraw(canvas);Log.d("mDebug", "onDraw");}@Overrideprotected void onFinishInflate() {// TODO Auto-generated method stubsuper.onFinishInflate();Log.d("mDebug", "onFinishInflate");}@Overrideprotected void onSizeChanged(int w, int h, int oldw, int oldh) {// TODO Auto-generated method stubsuper.onSizeChanged(w, h, oldw, oldh);Log.d("mDebug", "onSizeChanged,w="+w+",h="+h+",oldw="+oldw+",oldh="+oldh);}}
请勿发布不友善或者负能量的内容。与人为善,比聪明更重要!
技术博客集 - 网站简介:
前后端技术:
后端基于Hyperf2.1框架开发,前端使用Bootstrap可视化布局系统生成
网站主要作用:
1.编程技术分享及讨论交流,内置聊天系统;
2.测试交流框架问题,比如:Hyperf、Laravel、TP、beego;
3.本站数据是基于大数据采集等爬虫技术为基础助力分享知识,如有侵权请发邮件到站长邮箱,站长会尽快处理;
4.站长邮箱:[email protected];
文章归档
文章标签
友情链接