Android 如何画2/5的圆
我当前的代码如下:Android 如何画2/5的圆,android,drawable,Android,Drawable,我当前的代码如下: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="#E6EDFB" /> <size android:width="@dimen/_88sdp" android:height="@dimen/_44sdp" /&g
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#E6EDFB" />
<size
android:width="@dimen/_88sdp"
android:height="@dimen/_44sdp" />
<corners
android:topLeftRadius="@dimen/_44sdp"
android:topRightRadius="@dimen/_44sdp" />
</shape>
它画了半个圆:.
但我只想画一个2/5的圆,像这样:
.
我该怎么做呢?你可以尝试在底部画另一个矩形,然后用圆圈将其剪裁以获得所需效果。它会在底部形成空白区域吗?如果你使用与背景相同的颜色,则会产生一种较短半圆的错觉。或者您可以使用porter duff类中提供的各种剪裁方法来剪裁两个视图您可以尝试创建自定义视图,并在onDraw方法中绘制闭合路径弧。