How to customize style from spinner dropdown CHOICES?

谁说胖子不能爱 提交于 2019-12-08 01:06:00

问题


I can customize the background of the selected option on a spinner dropdown using:

<item name="android:spinnerStyle">@style/customSpinner</item>
<style name="customSpinner" parent="@android:style/Widget.Holo.Light.Spinner">
<item name="android:textColor">#000000</item>
<item name="android:background">#000000</item>
</style>

But I can't manage to change the background and textcolor of the list of options that the dropdown has. How do I achieve that?


回答1:


adapter.setDropDownViewResource(R.layout.custom_spinner);

custom_spinner.xml -

<?xml version="1.0" encoding="utf-8"?>
<TextView
  xmlns:android="http://schemas.android.com/apk/res/android"
  parent="@android:style/TextAppearance_Widget_DropDownItem"
  android:textColor="#988767"
>
</TextView>


来源:https://stackoverflow.com/questions/8077767/how-to-customize-style-from-spinner-dropdown-choices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!