EditText 未显示在冰淇淋三明治下
我的 EditText 布局为白色背景。 在 Android 2.x 上,EditText 是可见的,周围有一个框架,但在 Galaxy Nexus 上的 Ice Cream Sandwich 中,只有单击它才可见。然后出现其下方的蓝线。
我认为这是由于《冰淇淋三明治》中的全息主题造成的,但我能以某种方式让这条线一直显示吗?或者我是否必须添加自定义背景 9patch-图像?
我使用 ActionBarSherlock 来实现兼容性,但我认为这不是问题,因为 EditText 在旧版本上正常显示。
问候, 金
I have a EditText in a layout with a white background.
On Android 2.x, the EditText is visible with a frame around it, but in Ice Cream Sandwich on a Galaxy Nexus, it is not visible until I click on it. Then the blue line under it appears.
I think this is due to the holo theme in Ice Cream Sandwich, but can I somehow get the line to show all the time? Or do I have to add a custom background 9patch-image?
I am using ActionBarSherlock for compatibility, but I don't think this is an issue here, as the EditText is shown normally on older Versions.
Regards,
Kim
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议您为其创建自己的背景。您可以做的另一件事是,将视图设置为默认聚焦,这可能或可能不适用于您的应用程序的目的。
只需让您的视图在加载后调用 requestFocus() 即可。
I would recommend creating your own background for it. Another thing you can do is which may or may not work for your app's purpose is set that view to be focused by default.
Just have your view call requestFocus() after it's loaded.
如果您向 EditText 添加提示,则应该显示灰线。
您还可以通过覆盖 Holo 主题来创建自定义主题,但问题是为什么会让人们对平台的行为感到困惑。
If you add hint to the EditText then gray line should show up.
You can also create custom theme by overriding the Holo theme but why confuse people with platform's behavior is the question.