下の画像のような1つの形状を作成したいのですが、これをXMLコード(ドローアブル内)で作成したいのですが、 9.patch画像では作成したくありません!
xml コードでこの形状を作成するにはどうすればよいですか?
ここに回避策があります
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="10dp">
<solid android:color="#FFFFFF"/>
<corners
android:bottomRightRadius="0dp"
android:bottomLeftRadius="0dp"
android:topLeftRadius="15dp"
android:topRightRadius="15dp"/>
</shape>
角の半径を微調整して、上部を湾曲させます。
またはこの楕円形を重ねて、目的の出力を取得します
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<!--circle filling color-->
<solid android:color="#ffffff" />
<stroke
<!--radious can define in here-->
android:width="1dp"
android:color="#ffffff" />
<corners
android:bottomLeftRadius="2dp"
android:bottomRightRadius="2dp"
android:topLeftRadius="2dp"
android:topRightRadius="2dp" />
</shape>
しかし、基本的に、これはこれを行う正しい方法ではありません! 別の方法を使用して、9 パッチを使用します