1

我的应用程序绘制了一个覆盖层,它有一个GridView作为它的孩子。所有点击都被覆盖视图的onTouch事件捕获,并且没有任何内容传递给GridView'onItemClick事件。创建它的代码是:

LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
TaskBarView = inflater.inflate(R.layout.view_overlay, null);
TaskBarViewParams = new WindowManager.LayoutParams(TaskBarInactiveWidth, TaskBarHeight,
            LayoutParams.TYPE_PHONE,
            WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL |
            WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,
            PixelFormat.TRANSLUCENT);
TaskBarViewParams.gravity = Gravity.LEFT | Gravity.TOP;
windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
windowManager.addView(TaskBarView, TaskBarViewParams);

注意:此问题仅在API 级别 16 及更高级别出现GridView捕获它onItemClick并且覆盖正确捕获它,onTouch因为它应该低于 API 级别 16。

我错过了一面旗帜还是什么?

4

0 回答 0