EditText 未显示在冰淇淋三明治下

发布于 2025-01-08 18:02:54 字数 287 浏览 2 评论 0原文

我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清君侧 2025-01-15 18:02:54

我建议您为其创建自己的背景。您可以做的另一件事是,将视图设置为默认聚焦,这可能或可能不适用于您的应用程序的目的。
只需让您的视图在加载后调用 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.

不醒的梦 2025-01-15 18:02:54

如果您向 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文