白と灰色の境界線で塗りつぶされたOvalShapeを使用してカスタムShapeDrawableを描画しようとしています。私はこのようなドローアブルを作成しました:
ShapeDrawable drawable = new ShapeDrawable(new OvalShape());
drawable.getPaint().setColor(Color.GRAY);
drawable.getPaint().setStyle(Style.STROKE);
drawable.getPaint().setStrokeWidth(getPixels(5));
drawable.getPaint().setAntiAlias(true);
しかし、その結果は次のとおりでした:コーナーの問題
アイデアは、プログラムでこのような形を作成することですが、色は異なります。
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<corners android:radius="10dip"/>
<stroke android:color="#FF0000" android:width="5dip"/>
<solid android:color="@android:color/transparent"/>
</shape>
どうすればこれを修正できますか?