AutoCompleteTextView在LolliPop设备中的奇怪行为 [英] AutoCompleteTextView strange behaviour in LolliPop Device
问题描述
我在布局中使用了 AutoCompleteTextView
。但这是 colorControlNormal
和激活
无法正常工作的情况。
I am using AutoCompleteTextView
in my layout. But it's colorControlNormal
and Activate
is not Working as I expected.
我的颜色值为#0072BA
。
下面是不同设备的数字。
Below is figure for Different Device.
1。)Android Kitkat
2。)Android LolliPop
3。)Android棉花糖
我使用的Xml代码如下
Xml code that i used is below
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/md_black_1000"
android:layout_marginTop="5dp"
android:textSize="15sp"
android:text="Medical Store Name"
android:textColorHint="#999999"
android:layout_below="@+id/search_drug_store"
android:id="@+id/autoCompleteTextView_storename"
android:layout_marginLeft="15dp"
android:layout_marginRight="10dp"/>
<AutoCompleteTextView
android:id="@+id/autoCompleteTextView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="12sp"
android:textColor="#999999"
android:layout_below="@+id/autoCompleteTextView_storename"
android:layout_marginLeft="25dp"
android:inputType="textNoSuggestions"
android:layout_marginRight="10dp"/>
我没有给AutoCompleteTextView提供任何样式,然后为什么会发生?
I am not giving any style to AutoCompleteTextView then Why it's Happening ?
如果我给出此样式
参考材料设计链接:
http:// www。 materialdoc.com/autocomplete-view/
并给出此样式
<style name="Autocomplete" parent="Widget.AppCompat.Light.AutoCompleteTextView">
<item name="android:background">@color/green500</item>
<item name="colorControlNormal">@color/amber500</item>
<item name="colorControlActivated">@color/cyan500</item>
</style>
但是在棒棒糖中,什么都没有改变。
But in Lollipop nothing has Change.
棒棒糖版本中的这个错误还是我做错了?
Is this bug in lollipop version or i am doing something wrong ?
推荐答案
棒棒糖版本中没有错误,您不会忽略主题风格与您的风格配合使用,请以这种方式 https://stackoverflow.com/a/26631227/4745569
There is no bug in lollipop version you just not override the style of theme with your style,use in this way https://stackoverflow.com/a/26631227/4745569
这篇关于AutoCompleteTextView在LolliPop设备中的奇怪行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!