如何更改网格视图图像上的点击侦听器位置?

How to Change the click listener position on grid view images?

我正在为我的 android app 使用下面的 material 设计,在我的应用程序中我还包括新版本 23 上的导航抽屉,在这个网格视图中我点击每个图像打开新的activity 页,.

但是在我的应用程序中,我不会被打开,如果我点击部分部分上方的左侧,只会打开相应的 activity,

我知道如何正确更改网格视图图像上的点击位置吗,

请帮我解决我的问题,

请检查图像以进行说明!!!

提前致谢

您可以在适配器中添加 ClickListener

  @Override
    public View getView(int position, View convertView, ViewGroup parent) {

    LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    View gridView;

    gridView =new View(mContext);

    gridView = inflater.inflate(R.layout.gridview_members, null);

    Button city = (Button) gridView.findViewById(R.id.city);

                city.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

    //Toast here

        }});

    return gridView;
}

希望以上代码对您有所帮助