How to change the default spinner-layout? - android

I created with Android Studio 1.0 a new project and added a spinner. But the result doesn't look very understandable. It's not clear enough that the spinner is a clickable object. It shows only the top element and a small arrow down. My default Spinner
I've implemented the spinner the way the developer-page from android describes.
How can I change it to something, that looks more like this.
I've tried things like setting the background color, but in the result the little arrow disappears.
How is it possible, that my default layout looks so different from the declared one by developer.android.com?

In any case you can create your own custom spinner or set some selector to it. For example: http://androidexample.com/Custom_Spinner_With_Image_And_Text_-_Android_Example/index.php?view=article_discription&aid=84&aaid=107

Related

I am using spinners, I want to change the style in which they open

I want the spinner to open in a popup manner instead of the list manner which i am getting right now. I have tried changing the theme as well. The spinner worked in the popup manner in the lower version devices. What can i do?thanks in advance.
I want the opposite of what problem is discussed here Android: Change Spinner Dropdown view
On your xml file, set
android:spinnerMode="dialog"
on your spinner.

How can i customize the spinner?

My problem is straight-forward.
I have a default spinner in android API 19.
But i want to customize it to make it have a border and also a triangular shape at the end pointing at the bottom. (Like the spinner with old versions of android).
I have this spinner: http://androidopentutorials.com/wp/wp-content/uploads/2014/03/android-4-spinner.jpg?f9f065
But I want the spinner to be like this: http://lh4.ggpht.com/-DwIrYX29Rzg/TsPtjLkIkLI/AAAAAAAAAjs/m3GvtKmRDGo/firstLayout_thumb.png?imgmax=800
How can i customize the spinner?
I have searched for tutorials online but i got only those custom spinner with image and text together.
Have a look at this tutorial: http://www.mokasocial.com/2011/03/easily-create-a-default-custom-styled-spinner-android/
Basically, what you need is a 9-patch that you will use as a background of your Spinner.
The steps are fairly simple:
Get your 9-patches ready.
Create a <selector> that represents the stats of your Spinner by using these 9-patches.
Set the <selector> as the background for your Spinner.
The caveat to my approach is that you will have to set the background for every Spinner you use. If you want to 'do it once, use it everywhere', follow the tutorial approach where the author uses a custom theme.

Changing the color of the spinner

In this picture you can see (barely lol) that the spinner icons that rest on the bottom and bottom right are very hard to see due to the black background that I am using. What would I need to do to make that greyish looking color to white or any color for that matter?
Try this tutorial:
Android Custom Spinners
A similar process is used for working with custom buttons and other elements.
Updated as the link is broken. Try this stackoverflow answer
Spinner Background Design

how do I change the style of a button in android?

I want to change the style of a button in an android app. here is a picture that has both kinds of buttons, the one that I have now, and the one that I want to switch to:
the kinds of buttons that I am using now, look like any of the letters on that keyboard. the ones that I want to use like like the arrows. I would I go about changing this. I prefer to do it in xml but I can do it in java if that is the only way. Thanks
change the background of the Button to a png image with arrows!
in XML use android:background="#drawable/yourimage"
To get more sophisticated control check here,
Standard Android Button with a different color

Android: Why does my Spinner haven't got the standard design?

In my app I'm using a spinners to let the user select an item from a list. Everything works fine but I'm not really happy with the look of the spinner. As you can see in the image below it has the same design as a normal button.
What I want is a spinner which looks more like a normal text field. So I browsed a little bit through the drawable folder of the Android sources and found out that the spinner background should normally look quite different. I append an image of a spinner with the background image as I found it in the drawable folder. Although the spinner in the image is focused, I think you can see the difference between both spinners.
Now I'm wondering why the my spinner (first one) doesn't have the same design as the second one as II didn't changed any attributes which are related to the design of it. Where does this button like design come from?
The first spinner screen depicts the default spinner.
So the answer is that you've expected the wrong behavior. You can however create your own spinner look.
Looks to me that the second spinner was there in the earliest versions of the android sdk and just remains there as is.

Categories

Resources