Reputation: 51
i would like to draw a line 1px wide that is gradient at both ends. I can use an image instead but would like to do this with xml drawing in a relative layout.
Upvotes: 2
Views: 1233
Reputation: 2383
You could do something like this in the <shape>
XML:
<gradient
android:angle="0"
android:startColor="#000000"
android:endColor="#000000"
android:centerColor="color_you_want" />
And then set your view to use the drawable as a background, 1dp thick
Upvotes: 4