activy的onTouch事件中根据坐标能否转换成相应的控件?? @Override public boolean onTouch(View v, MotionEvent event) {event。x y 通过坐标 得到点击下的控件对象能否实现??} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Rect frame = mTempRect; final int count = getChildCount(); for (int i = count - 1; i >= 0; i--) { final View child = getChildAt(i); child.getHitRect(frame); if (frame.contains(x, y)) { return child; } } 没有直接点的方法??类似getcontrolbyposion() 问题是每个控件都有一个onTouch事件,何必用这个方法去找到哪个控件被touch呢? 不是有View参数吗所有的控件都 用一个listener侦听不行吗 用SensorSimulator遇到问题 想求助下 求助,想画个课程表,没思路 像素问题 请教关于Tabs页面里的onResume()复写问题 一个空的service占用10M左右的内存 求助:AVD上测试 createNewFile 文件名显示乱码 android获取本机号码的方法 怎样实现软键盘和触摸屏的事件记录 Linearlayout布局下的控件能有间隔么 android4.0中在onCreate方法中findViewById()返回null 找不到文件 关于TextView显示换行的问题
final int count = getChildCount();
for (int i = count - 1; i >= 0; i--) {
final View child = getChildAt(i);
child.getHitRect(frame);
if (frame.contains(x, y)) {
return child;
}
}
类似getcontrolbyposion()