分清每个View的id,即可解决问题。
LinearLayout okParent = (LinearLayout) this.findViewById( R.id.okLayout );
LinearLayout cancelParent = (LinearLayout) this.findViewById( R.id.cancelLayout );
Button okButton = (Button) okParent.findViewById( R.id.id_name );
Button cancelButton = (Button) cancelParent.findViewById( R.id.id_name );
本文详细介绍了如何通过明确每个View的id来解决Android开发中遇到的问题,包括使用findViewById方法获取特定组件,并对其进行操作。文章旨在帮助开发者更高效地管理和使用UI元素。
174万+

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



