サンプル1 楕円 shape=”oval”

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<size
android:width="100dp"
android:height="60dp"/>
<solid
android:color="#32cd32" />
<stroke
android:width="3dp"
android:color="@color/gray_dark" />
</shape>
備考 JAVA側の実装
//Drawableリソースを取得
Drawable btn_color = ResourcesCompat.getDrawable(getResources(), R.drawable.button_test1, null);
//ボタンにDrawableをセット
button.setBackground(btn_color);


