How do I specify that the background “colour” of a Android layout view element should be a gradient (at a specific angle) ?
I wish to specify this in the XML, i.e. not at runtime. Preferably as a style I can apply to any layout I wish with the style property?
create
gradient.xmlin/res/drawable:and in your
main.xmllayout file in/res/layout:you can specify the angle by replacing the
android:anglevalue and start/end colour by replacingandroid:startColorandandroid:endColor