我想将微调项上列表选择器的颜色更改为丑陋的橙色默认值以外的颜色。根据我的阅读,执行此操作的方法是设置 android:spinnerSelector
属性。但是,在 Eclipse 中,当我尝试设置 android:spinnerSelector
属性时出现此错误
error: No resource identifier found for attribute 'spinnerSelector' in package 'android'
这是我的 xml 文件,里面有微调器;
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/darkgray" >
<Spinner
android:id="@+id/timespinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:spinnerSelector="@drawable/my_selector"
android:drawSelectorOnTop="true"
android:prompt="@string/timeprompt" />
</RelativeLayout>
最佳答案
android:spinnerSelector
属性不再是 API 的一部分。
这篇文章可能有解决方法:Android: How to set spinner selector to own image/icon?
关于Android 在添加 spinnerSelector 时出错,找不到资源标识符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10988583/