禁用图库视图
我在 Android 应用程序中禁用图库中的视图时遇到问题。当我单击视图时,视图似乎没有发生任何事情。这是我的 onItemClick(...)
方法:
@Override
public void onItemClick(AdapterView<?> adapterView, View view,
int position, long id) {
view.setEnabled(false);
}
我也尝试过 setVisibility(...)
我缺少什么?
提前致谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想将视图设置为不可见,请尝试这段小代码:
这会将视图设置为不可见,我认为您无法再将其聚焦。但如果您在网格内工作,就会留下间隙。
If you want to set your view invisible, try this little piece of code:
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.