2015-12-17 60 views
0

如何在android中的file.xml中获取此效果?如何在android中创建形状三角形

FirstPicture

SecondaryPicture

+5

你的意思是[Rounded Rectangles?](http://stackoverflow.com/questions/5618402/how-to-draw-rounded-rectangle-in-android-ui) – gtgaxiola

+0

是的,但我需要加入2x颜色看图片我不现在我怎么能做到这一点。现在我得到了这个:http://postimg.org/image/ytu1527zd/ 我需要在底部红色圆角矩形和顶部的所有黑色圆角矩形。 – Muzzik

回答

1

使用XML层列表绘制,并把两个矩形彼此的顶部。在xml drawable的角标记中,使用topLeftRadius,topRightRadius,bottomLeftRadius和bottomRightRadius来控制每个角是否被独立舍入。

+0

问题解决了!谢谢你:) http://pastebin.com/gK7fMi4k – Muzzik