Jacksonkr
Jacksonkr

Reputation: 32207

Gradient stroke shape

I want to make a stroke that has a gradient on the stroke and use the stroke as a background for a selected button. Is this possible using a <shape> or will I need to use a 9-slice image?

I can connect the parts, I just don't know that a gradient on a <shape> is possible, but if it is I'd rather do that than create a png image.

Upvotes: 3

Views: 6501

Answers (1)

huygir
huygir

Reputation: 121

Shape (rectangle) supports a gradient fill. You can also round the corners to get a nice toolbar button effect.

I don't think that stroke supports a gradient, but if you want a gradient stroke around your button you can create two layered rectangles - the first one using your gradient and the second using a solid or a different gradient sized to be 2 pixels smaller in height and width.

Upvotes: 7

Related Questions