View不同,id相同的问题
2016-01-29 19:21
295 查看
分清每个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 );
相关文章推荐
- Java enum
- 计算1到N中1出现的次数(分类讨论,数论)
- JSON数据中存在单个转义字符“\”的处理
- 模拟QQ系统设置面板实现功能
- javascript设计模式实践之迭代器--具有百叶窗切换图片效果的JQuery插件(一)
- Css Hack
- R语言RJava安装步骤
- python 字符串的操作方法
- 【移动端兼容问题研究】javascript事件机制详解(涉及移动兼容)
- Linux 标准Shell Bash 的基本功能
- 使用php创建mysql的表格
- cocos2dx CCLabelTTF自己定义字体的使用
- Node.js系列基础学习----安装,实现Hello World, REPL
- Android给控件添加触摸回调
- Android给控件添加触摸回调
- 【BZOJ】1007 水平可见直线
- Qt持久性对象进行序列化(同时比较了MFC与Java的方法)
- centos编译yaf时make出错
- Ubuntu下ssh免password登录安装
- android studio添加so库