I try to use the GradientDrawable to set a gradient to some backgrounds and buttons. Sadly the documentation is not very detailed.
What are the main attributes to configure the gradient? I understand start and endcolor but some of the other attributes could need some explanation.
At the moment I used images as the background for the buttons but a drawable defined in XML would be much nicer.
I try to get a look like this (It is a very light gradient): alt text http://janusz.de/~janusz/RedButton.png
A Drawable with a color gradient for buttons, backgrounds, etc. It can be defined in an XML file with the <shape> element.
Designers are trying out different styles and combinations which go best with the Android App. One of the key components of Android being used these days is called GradientDrawable. A GradientDrawable is drawable with a color gradient for buttons, backgrounds, etc.
use this xml as background to the imageview.
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:angle="90" android:startColor="#7c0000" android:endColor="#A71C1C"/> </shape>
thats it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With