开发者

Android borders on individual views

开发者 https://www.devze.com 2023-04-08 01:05 出处:网络
I have trouble making borders for android views What I try to do for simulating a border is to create a view with the main background, then create a view around it with the border color as the backgr

I have trouble making borders for android views

What I try to do for simulating a border is to create a view with the main background, then create a view around it with the border color as the background. the first view then has a padding around it, but the wrapping border view still does not show re开发者_Python百科liably

How do I fix this problem and what is a better way to add a border color around an element?


You can define a Shape (make it a rectangle, define a stroke) and use that shape as the background of yout view. You can also define rounded corners.

If you need something more elaborated, you can make a 9-patch image and use that as the background.

0

精彩评论

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