how to fill a view with a gradient background color
I am cre开发者_运维知识库ating the Android version of an iPhone app, and i need them to look as close as possible.
A problem with this is creating the bars and filling them with a gradient color.
Is there a way to fill a view (probably a layout) with a gradient color, other than using background images?
Thanks in advance.
You can create a shape drawable http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape that is a gradient and set it as the background of your view.
If you want to have the gradient overlaying another image, you could use a layerlist http://developer.android.com/guide/topics/resources/drawable-resource.html#LayerList
精彩评论