Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android error when adding a spinnerSelector, no resource identifier found

I want to change the color of the list selector on a spinner item to something other than the ugly, orange default. From what I read, the way to do this is to set the android:spinnerSelector property. However, in Eclipse, I get this error when I try to set the android:spinnerSelector property

error: No resource identifier found for attribute 'spinnerSelector' in package 'android'

Here is my xml file with the spinner in it;

<?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>
like image 219
erin Avatar asked Jun 11 '12 22:06

erin


1 Answers

The android:spinnerSelector attribute is no longer part of the API. This post may have a workaround: Android: How to set spinner selector to own image/icon?

like image 127
David Avatar answered Oct 30 '22 15:10

David