TableLayout tableLayoutInstance;
// 假定是button
ArrayList<View> touchables = tableLayoutInstance.getTouchables();
for(View touchable : touchables){
if( touchable instanceof Button )
((Button)touchable).setEnable(false);
}
本文介绍了一种方法,用于遍历TableLayout内的所有可触摸视图,并针对其中的Button类型视图进行禁用处理。
TableLayout tableLayoutInstance;
// 假定是button
ArrayList<View> touchables = tableLayoutInstance.getTouchables();
for(View touchable : touchables){
if( touchable instanceof Button )
((Button)touchable).setEnable(false);
}

被折叠的 条评论
为什么被折叠?