Trying to get my custom spinner look to work - android

I have edited the spinner image by changing the color of it. Then used the draw9patch.bat tool to create it into a proper 9-patch file, and then renamed it to spinner_updated.9.png, then I placed it into my "res/drawable" folder. So I then checked out this link just to get an idea of implementing a custom spinner:
How to create android spinner without down triangle on the right side of the widget
I tried using lencinhaus & Aleadam ways but when I try to actually use it in my app I keep getting the error:
Failed to convert #android:drawable/spinner_updated into a drawable
Couldn't resolve resource #android:drawable/spinner_updated
What am I doing wrong? What would I do once I have the image I want to use for my spinner to actually get it displaying in the app?

If you are using your own drawable you need to use:
#drawable/spinner_updated
The #android: directs the app to look in Android's built-in resources not your own.

Related

iOS equivalent to androids colors.xml

I'm developing an app with different brandings that do share the same codebase for most parts. In my android project, I got a xml file for every branding containing the colors. Every view used the color codes defined within these xml files instead of using 'hard coded' color codes.
I would like to achieve the same thing within iOS. How can I do this? I would prefer a solution that does not involve dragging all references into the view controller and set colors via code. Is this possible with Xcode?
Please click on a view and check for Background.Click on dropdown and check
other... is present , click on that now follow the screenshot attached.

Android: Locating basic drawable

How do you reference the drawable for the 'home as up' icon?
I am trying to add this drawable in a custom XML layout. I do not want to change the icon displayed in the ActionBar, but rather use the drawable for something completely different
Tips on how to go about finding it without searching through every item are appreciated!
This image is named as ic_ab_back_holo_dark_am.png
or ic_ab_back_holo_light_am.png
These images are at sdk/platforms/version/data/res/drawable-versions where version must be 11 or later.
like
sdk/platforms/android-19/data/res/drawable-hdpi. You can find all images from there with there actual name.

How to customize android widgets

Hi I am a beginner in android and I want to know how to customize buttons,check box etc., I searched in web but found many ways and got confused...
Can you please tell me what are the ways to customize android widgets, can we do that using css, like we do for the HTML?
Thanks in advance...
There are a few ways. You can use 9patch to edit the files inside the SDK(which will typically be C:\Android\SDK\platforms\android-19\data\res\drawable-hdpi) - Android-19 is the api level, and then set them in your xml layout under the widget you want with
android:background="#drawable/your file"
Another way is to create a selector(Recommended because it can handle stuff like when clicked and more), shape(Simple creation with corners and stuff), layer list(Advanced selector) or solid(just a color) in /drawable and then set them in your xml under the widget you want with
android:background="#drawable/your file"
An example of the second solution can be found here android button selector

Android Wheel-like loading icon

I'm trying to render a loading circle in one activity whose data gets populated by an async task. I'm not using default progressbar, because the icon in older version of Android looks like this:
I know how to use an ImageView or ProgressBar with a custom image and a rotation animation, but I haven't been able to find new official Android's looking icon anywhere. The one that looks like this:
Or maybe there is another way to generate this kind of spinning wheel animation in Android 2.2.
In general it's good to stick with the style set on that system.
If you still want the newer spinning wheel animation, set the indeterminateDrawable XML property on the ProgressBar. You can find the drawable XML files in the SDK folder under [android-sdk]\platforms\android-17\data\res\drawable called progress_medium.xml and others. You'll also need the referenced icon files stored in the drawable-**** folders.
check folder SDK_DIR\platforms\android-x\data\res\drawable-hdpi.
There should be spinner drawables like "spinner... "

android system drawable ic_btn_round_more

is there some way how to access android system private drawable: ic_btn_round_more?
This is the more icon which is used
in DialogPreference (res.layout.preference_dialog.xml)
It's not accessible through android.R.drawable
I don't want to copy bitmap file, because
that icon can be different for every device.
I found this: http://www.androidjavadoc.com/2.3/android/R.attr.html#moreIcon But I'm not sure how can I use it. Basically I'm trying to add more icon to my custom ListView,
which whould look exactly android way.
You can use Nine-patch to create your own rounded button which can be exactly the same as drawable ic_btn_round_more. you can get more information about how to use Nine-Patch here : http://developer.android.com/guide/developing/tools/draw9patch.html

Categories

Resources