自定义网格视图中的onClick更改视图属性是否重复?

时间:2015-11-25 06:52:43

标签: android android-layout android-fragments

图像以网格重复方式变为透明,而不是仅单击网格视图。

    grid.setAdapter(gridadapter);
    grid.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id)
        {
              ImageView watched=(ImageView)view.findViewById(R.id.grid_image);
              watched.setAlpha(50);
              Log.i(TAG,"Clicked");
        }
    });

0 个答案:

没有答案