我使用 layoutparams 来设置一些视图的位置,有些是重叠的。当我触摸重叠部分时,包括重叠部分的两个视图都对应于触摸事件!但我只想要上面的一个对应,有人可以帮助我吗?感谢您的回答!
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams( 50, 50 );
params.Left_AlignMargin = 100;
params.Top_AlignMargin = 100;
relativeLayout.addView( imgeView, params );
params = new RelativeLayout.LayoutParams( 50, 50 );
params.Left_AlignMargin = 50;
params.Top_AlignMargin = 100;
relativeLayout.addView( imageView2, params );
//when i clicked the overlapped part, both imageview correspond to my action.how to deal with this ?