简体   繁体   English

在Android中塑造边框

[英]Shape Border In Android

How can I draw a rectangle that have a black border and white background? 如何绘制具有黑色边框和白色背景的矩形? I don't understand shape tags in xml! 我不了解xml中的形状标签! Both solid and stroke do same thing? 实体和笔画都做同一件事? please let me understand. 请让我明白。

Use shapes to make the white rectangle you need and Stroke to get the black border you require . 使用形状制作所需的白色矩形,并使用“描边”获得所需的黑色边框。 Define a xml for this in your drawables folder and use . 为此在您的drawables文件夹中定义一个xml并使用。 Refer to this link 参考此链接

http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM