android在布局中怎么获得子布局 布局里嵌套了3层布局,我想在代码里获得最里面布局,以便添加监听,LayoutInflater里好像只能获得在res文件夹里的xml文件的id,有知道的能说下吗,谢啦 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //最外层的layout LinearLayout l = (LinearLayout)getViewById(R.layout.XXXX); int childCount = l.getChildCount(); //遍历下面所有的子控件,判断是否是layout for(int i = 0; i < childCount; i++){ if(l.getChildAt(i) instanceof LinearLayout || l.getChildAt(i) instanceof RelativeLayout || l.getChildAt(i) instanceof TableLayout || l.getChildAt(i) instanceof AbsoluteLayout){ //操作代码 } } 刚想出来···没那么麻烦直接View view = findViewById(R.id.ID);就OK了,然后添加监听隐藏显示什么的都能做了···谢啦 怎么做邀请码?? Eclipse是什么的东西,一个平台 keytool会不会不同的开发者生成相同的密钥 多层嵌套的xml该如何处理? android sdk 的问题 求助!Bitmap转换为byte[]存入数据库后再读出来不一样了 求帮忙 新手提问关于打包图片资源的问题! 求助,调用相机将图片显示到一个imageview上,用的系统自带相机可以得到正常照片,但是调用其他相机如360相机则图片特别不清晰。 android打成apk文件安装后,功能丢失 Android新手求有效学习方法 android中用Http的方式访问远程服务器
//最外层的layout
LinearLayout l = (LinearLayout)getViewById(R.layout.XXXX);
int childCount = l.getChildCount();
//遍历下面所有的子控件,判断是否是layout
for(int i = 0; i < childCount; i++){
if(l.getChildAt(i) instanceof LinearLayout || l.getChildAt(i) instanceof RelativeLayout || l.getChildAt(i) instanceof TableLayout || l.getChildAt(i) instanceof AbsoluteLayout){
//操作代码
}
}
直接View view = findViewById(R.id.ID);就OK了,然后添加监听隐藏显示什么的都能做了···谢啦