解决方案 »
- 判断有几张手机卡
- android2.3 USB网卡,USB以太网
- 类型 View 中的方法 setOnClickListener(View.OnClickListener)
- 自己用CXF+spring+hibernate写了个简单的webservice,用android虚拟机连接老是报错
- eclipse导入第三方jar包HttpClient 编译不过问题
- 通过USB 传输数据,请大侠赐教!谢谢!
- xml中不能直接添加ViewGroup吗
- 求助:在shape中使用gradient渲染按钮,偶尔会出现失效的情况
- android录制屏幕的功能如何实现?
- 安卓viewpager+fragement实现tab选项卡之后后台崩了
- lan8720网卡mac地址如何固定android4.0(linux2.6.34)
- 紧急求助 android如何通过post请求获得服务器返回string信息 急用但是本人被赶鸭子上架、、
for(int i = 0; i < v.getChildCount();i++) {
View vv = v.getChildAt(i);
vv.setOnClickL..(new Cl.///() {
public void click(View view) {
id= vv.getId();
}
})
}
你试试
然后把MainActivity的监听传过去
View没有getChildCount()属性,但mScrollTypeLayout.getChildCount();因为我在HorizontalScrollView下还加了LinearLayout,所以我这样写:mScrollTypeLayout = (ScrollTypeLayout)findViewById(R.id.article_type_layout);
LinearLayout mLinearLayout = (LinearLayout)mScrollTypeLayout.getChildAt(0);
for(int i = 0; i < mLinearLayout.getChildCount(); i++)
{
View child = mLinearLayout.getChildAt(i);
child.setOnClickListener(this);
}但还是不行,LinearLayout下面已经是我想要的TextView,但是mLinearLayout.getChildCount为0
所以结贴了,再开一个来问.