视图不会重绘
当用户选择菜单选项时,我在 onMenuItemSelected 中捕获它,然后调用
findViewById(R.id.xyz).setVisibility(View.VISIBLE);
但视图并不可见。我尝试了各种方法来强制重绘,但它就是不会重绘。
想法?
when a user selects a menu option, I catch it in onMenuItemSelected and then call
findViewById(R.id.xyz).setVisibility(View.VISIBLE);
But the view doesn't become visible. I tried all kinds of things to force a redraw, but it just won't redraw.
ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能将其转换为任何类型的对象,例如它是一个按钮:
我知道我会尝试,甚至:
但是它可能与您的 Z 顺序有关。您可能会以一种奇怪的方式绘制它们,因此它正在被绘制,但只是在另一个视图下?请随时通知我们,我相信您会找到解决方案!
Possibly casting it to whatever type of object it is, such as if it were a button:
I know I would try that and even :
However it might have something to do with your Z-order. You might be drawing them in a weird way so it is being drawn, but simply beneath another view? Keep us posted, and I'm sure you'll find the solution!