Android:如何使用XML中的一个角创建圆形?

Bri*_*ian 1 xml android shape

我需要在xml中为android项目描述以下形状.我知道有一个圆角的回转,但我怎么能实现那个矩形只有一个角落,其余的圆角?

我在xml中需要的形状

这不会像人们在很多问题中提到的那样被用作文本语音泡沫.我只想将形状用作一行文本的背景.形状颜色应该易于动态变换.

谢谢你的帮助.

lcw*_*_gg 6

您可以将其添加到drawable文件夹中的文件中:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<solid android:color="@android:color/holo_blue_dark" />
<corners
    android:bottomLeftRadius="0dp"
    android:bottomRightRadius="15dp"
    android:topLeftRadius="15dp"
    android:topRightRadius="15dp" /></shape>
Run Code Online (Sandbox Code Playgroud)