开发者

Disable Gallery View

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜