onfinishinflate()方法

来源:互联网 发布:适马usb dock 软件 编辑:程序博客网 时间:2024/05/22 20:28
比如你 自定义一个view叫myView ,路径是,com.test.view.MyView,此view是继承LinearLayout,定义的布局文件是my_view.xml
里面内容是:
<com.test.view.MyView>
        <xxxx />
</com.test.view.MyView>

当你在使用的时候,可以这样使用
MyView mv = (MyView)View.inflate (context,R.layout.my_view,null);
当加载完成xml后,就会执行onfinishinflate()方法。
0 0