Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8889711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:19:41+00:00 2026-06-14T22:19:41+00:00

In android, I can apply a custom style based on versions: +-res/values-v14/styles.xml +-res/values/styles.xml but,

  • 0

In android, I can apply a custom style based on versions:

+-res/values-v14/styles.xml
+-res/values/styles.xml

but, how can I apply a defined style based on version?

in values/styles.xml:

<style name="spinner_textview">
    <item name="style">@android:style/Widget.Spinner></item>
</style>

the following line causes error in eclipse

<item name="style">@android:style/Widget.Spinner</item>

Eclipse says: No resource found that matches the given name: attr
‘style’.

is there a way that I can apply style based on api version?

PS: i’m try to apply @android:style/Widget.DeviceDefault.Spinner to a TextView, but the style is only available in api 14+;

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:19:43+00:00Added an answer on June 14, 2026 at 10:19 pm

    You are trying to specify the style within a style declaration.

    Instead, your style should have “@android:style/Widget.Spinner” as it’s parent to inherit all it’s attributes.

    <style name="spinner_textview" parent="@android:style/Widget.Spinner" >
     ...
    </style>
    

    This same style should have different parents depending on the version ( by using the values-XX folders )

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to retrieve Android style values at runtime, so I can apply them
I read the http://developer.android.com/guide/practices/screens_support.html.com ? but couldn't get how to apply this, can anyone
I have the following drawable: <?xml version=1.0 encoding=utf-8?> <shape xmlns:android=http://schemas.android.com/apk/res/android> <gradient android:startColor=#2F2F2F android:endColor=#5A5A5A android:angle=90
I apply a custom theme to my activity with: <activity android:theme=@style/MyTheme> , in which
how can load and apply css if detects android: if( navigator.userAgent.match(/Android/i) { load css
I have a custom style that I would like to apply to my views.
Android has with version (4+ ?) introduced offline maps where I can on the
My Android application can't use XML buttons, because the size and label of the
I have PreferenceActivity with some sample content: <?xml version=1.0 encoding=utf-8?> <PreferenceScreen xmlns:android=http://schemas.android.com/apk/res/android> <PreferenceCategory android:title=First
Can android recognize more than two simultaneous touches (3, 4, etc...)? Is the number

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.