Har*_*iya 7 android autocompletetextview android-layout android-design-library android-5.1.1-lollipop
我正在使用AutoCompleteTextView我的布局.但它colorControlNormal并Activate没有像我预期的那样工作.
我的颜色值是#0072BA.
下面是不同设备的图.
1.)Android Kitkat
2.)Android LolliPop
3.)Android Marshmallow
我使用的Xml代码如下
<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"/>
Run Code Online (Sandbox Code Playgroud)
我没有给AutoCompleteTextView任何样式然后它为什么会发生?
如果我给这个风格
参考材料设计链接:
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>
Run Code Online (Sandbox Code Playgroud)
但在棒棒糖中没有任何变化.
这是棒棒糖版本中的错误还是我做错了什么?
实际上这不是这个问题的解决方案,但您可以使用它在整个设备上进行独特的设计。我已经在 xml 中实现了这样的 edittext,为 edittext 设置背景 null 并在 edittext 下面添加水平线。
<EditText
android:id="@+id/newPasswordEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:background="@null"
android:textColor="@color/color_black"
android:inputType="textPassword"
android:layout_marginBottom="10dp"
android:hint="Enter New Password"
android:layout_marginTop="10dp"
android:textSize="14sp"
android:layout_below="@+id/titleTextView" />
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="2dp"
android:orientation="horizontal"
android:layout_marginBottom="7dp"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_below="@+id/newPasswordEditText"
android:background="@color/color_standard_green" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
555 次 |
| 最近记录: |