开发者

Disable Gallery View

开发者 https://www.devze.com 2023-02-04 17:19 出处:网络
I have a problem disabling views from my Gallery in my Android application. Nothing seems to happen with the View when I click it. Here is my onItemClick(...) method:

I have a problem disabling views from my Gallery in my Android application. Nothing seems to happen with the View when I click it. Here is my onItemClick(...) method:

 @Override
 public void onItemClick(AdapterView<开发者_开发技巧?> adapterView, View view,
   int position, long id) {
        view.setEnabled(false);
    }

I have also tried setVisibility(...) What am I missing?

Thanks in advance.


If you want to set your view invisible, try this little piece of code:

view.setVisibility(View.GONE);

This sets the view invisible and i think you can't focus it anymore. But if you're working within a grid, there will be a gap left behind.

0

精彩评论

暂无评论...
验证码 换一张
取 消