开发者

Gradient stroke shape

开发者 https://www.devze.com 2023-03-24 18:58 出处:网络
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 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号