1

I am using a spinner:

<Spinner
    android:id="@+id/spinner"
    android:layout_width="60dp"
    android:layout_height="30dp"
    android:layout_alignBottom="@+id/text"
    android:layout_marginLeft="10dp"
    android:layout_marginStart="10dp"
    android:layout_toEndOf="@+id/text"
    android:layout_toRightOf="@+id/text"
    android:gravity="center|center_horizontal"
    android:popupBackground="@color/spinner_pop"
    android:spinnerMode="dropdown" />

The above code is showing a message Resouce id 0x1010081 is not of type STYLE (instead attr) but didn't mentioned as an error.

I have tried running this code, and the layout works exactly how I want it to and I am not getting any error.

I have searched, but I am not able to find a proper solution to remove the message in the graphical layout view of my xml layout.

This https://stackoverflow.com/a/16588522/2508414 doesn't work in my project.

The question is, will my current layout create any issue in the future?

I am running this in Eclipse Kepler, Android API Level 19.

App will be running only in API Level 16 and above.

Edit: If I changed the Api Level for building the layout to 20 and above, the message goes off. The message is showing only when I am using API level 19 and below.

enter image description here

6
  • attach screenshot of error
    – Rajesh
    Dec 1, 2015 at 5:14
  • @Survivor I have added the screen shot. Dec 1, 2015 at 5:42
  • did you try after android:popupBackground="@color/spinner_pop" android:spinnerMode="dropdown" remove this line?
    – Rajesh
    Dec 1, 2015 at 6:01
  • My requirement was spinnerMode="dropdown", so can't remove. Though removing that line only solve the message issue. Dec 1, 2015 at 6:19
  • man it is not available in API level 19 so this give you error if you actualy need it then use // Creating adapter for spinner ArrayAdapter dataAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item, categories); // Drop down layout style - list view with radio button dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // attaching data adapter to spinner spinner.setAdapter(dataAdapter); programmatically
    – Rajesh
    Dec 1, 2015 at 7:05

1 Answer 1

0

Try this

<Spinner
android:id="@+id/spBloodbanks"
style="@style/Widget.AppCompat.Light.DropDownItem.Spinner"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="45dp"
/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.