您的位置:首页 > 移动开发 > Android开发

android中更改spinner、AutoCompleteTextView分割线的颜色

2015-04-02 11:29 375 查看
话说去除分割线的方法找了很久也没找到,终于发现了更改分割线的方法

spinner和AutoCompleteTextView提示列表中间有一条黑色的分割线,想要改变它的颜色值,就要重写style。

1.在themes里写个style

<style name="applicationTheme" parent="@android:style/Theme.Light">
<item name="android:dropDownListViewStyle">@style/mySpinnerStyle</item>
</style>

<style name="mySpinnerStyle" parent="android:style/Widget.ListView.DropDown">
<item name="android:divider">#00000000</item>
<item name="android:dividerHeight">1dp</item>
</style>


2.控件所在的activity的manifest里调用style

<activity
android:name=".MainA"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
<span style="background-color: rgb(255, 0, 0);">android:theme="@style/applicationTheme"</span>  >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>


列表就是没有分割线的样式了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐