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.
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.
精彩评论