ActionBarSherlock和自定义文本框(延伸AutoCompleteTextView) [英] ActionBarSherlock and custom TextBox (extends AutoCompleteTextView)
问题描述
好吧,我在这个快要疯了 - 我已经融入我的应用程序ActionBarSherlock和正在使用Theme.Sherlock。现在,我似乎无法让我的自定义文本正常工作 - 当我离开文本框,文本变成白色。以下是图像,以便更好地说明问题了(我从附带库示例中使用的覆盖布局):
OK, I'm going crazy over this - I've integrated ActionBarSherlock in my app and am using Theme.Sherlock. Now, I can't seem to get my custom textbox to work properly - whenever I leave textbox, text becomes white. Here is image to better explain the problem (I've used Overlay layout from examples that come with the library):
键入
让我们回到的EditText:
Going back to EditText:
有没有人有想法,为什么发生这种情况?
Does anyone have idea why this is happening?
编辑::要重现此错误只需下载ZIP的ActionBar并提取样本项目。然后在第一的LinearLayout覆盖布局(RES /布局/ overlay.xml)该项目只需要添加:
To reproduce this error simply download the ActionBar zip and extract sample project. Then in that project in Overlay layout (res/layout/overlay.xml) in first LinearLayout just add:
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext" />
<AutoCompleteTextView
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
和设备上使用旧版本的Android操作系统上运行示例项目。
And run sample project on device with older version of Android OS.
推荐答案
好了,现在我明白了,为什么没有人能够回答这个问题 - 它似乎只对特定设备发生!所以,在我的情况,我复制它在老亚马逊Kindle。
OK, now I get it why nobody was able to answer this - it seems to happen only on specific devices! So, in my case I was reproducing it on old Amazon Kindle.
目前的解决方法我终于找到了,这对我的作品,是通过获取默认的EditText(是啊,pretty丑)的文字颜色设置我的控制文字颜色。
The current workaround I finally found, that works for me, is to set textColor of my control by getting textColor of default EditText (yeah, pretty ugly).
如果有人有更好的主意 - 你让我知道
If someone has better idea - do let me know.
这篇关于ActionBarSherlock和自定义文本框(延伸AutoCompleteTextView)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!