mInflater = getLayoutInflater();
layout1 = mInflater.inflate(R.layout.personalcenter_1, null);
ib_friends = (ImageButton)layout1.findViewById(R.id.ib_friends);
获取include中的布局里的组件
<include android:id="@+id/main1" layout="@layout/sublayout" />
先find include布局作为view,然后find include里的组件
View subLayout1 = (View)findViewById(R.id.main1);
Button myButton_main1 = (Button)subLayout1.findViewById(R.id.mybutton);
分享到:
相关推荐
这个demo主要实现了inflate的使用,希望可以帮助需要的同学.
Js算法 zip_deflate(压缩)与zip_inflate(解压),
matlab开发-Inflate。使用bls.gov的CPI通货膨胀计算器调整通货膨胀。
Inflate与listView联合使用,自定义出一个listView,这是一个较为复杂的listView的实现,非常实用。
帮助你更好的理解LayoutInflate中的inflate方法,以后想怎么用怎么用
资源来自pypi官网。 资源全名:inflate-0.1rc1-py3-none-any.whl
博客《ListView滑动删除实现之一——merge标签与LayoutInflater.inflate()》对应源码,博客地址:http://blog.csdn.net/harvic880925/article/details/45155965
python库,解压后可用。 资源全名:stream_inflate-0.0.13-py3-none-any.whl
android inflate demo,方便新手使用,下载导入android studio就可直接运行,简单明了的展现inflate不同参数的区别
LayoutInflater.from(context).inflate()方法的调研
高效:Flap 最大程度上减少了样板代码,例如无需自定义 itemViewType ,也不需要自己实例化组件, 你可以和 new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.xxx, parent, false)));...
LayoutInflater源码分析 inflate方法的区别
Android LayoutInflater.inflate...我尝试在Google官方文档与网络上其他讨论中寻找有关的说明,而后发现许多人不但不清楚LayoutInflater的inflate()方法的细节,而且甚至在误用它。 这里的困惑很大程度上是因为Google
本文实例讲述了Android开发中setContentView和inflate的区别。分享给大家供大家参考,具体如下: 一般用LayoutInflater做一件事:inflate inflate这个方法总共有四种形式(见下面),目的都是把xml表述的layout转化...
最近一直想弄明白LayoutInflater对象的inflate方法的用法,今天做了实例。 android:layout_width=match_parent android:layout_height=200dp android:background=#FF0000 android:orientation=vertical> ...
Android 的Gone 实例。欢迎大家下载学习
本文主要介绍Android 中Inflate 方法的用法, 在开发Android应用过程中,可以在程序中应用 Inflate()方法加载新布局,希望能帮助有需要的朋友