にサークル形状を作成するためのコードです。
は、手順に従っ: -
1.Createdドットまたは塗りつぶされた円を描画する描画可能なフォルダにdot.xmlと呼ばれるXMLファイルを。
//Dot.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >
<solid android:color="@color/colorTimeline" />
</shape>
2.以下のコードをレイアウトファイルに挿入します。
<View
android:id="@+id/v1"
android:layout_width="1dp"
android:layout_height="50dp"
android:background="@color/colorTimeline"
android:contentDescription="ad"
android:layout_marginStart="10dp"/>
<View
android:id="@+id/v2"
android:layout_width="16dp"
android:layout_height="16dp"
android:background="@drawable/dot"
android:contentDescription="f"
android:layout_marginStart="3dp"
android:layout_below="@id/v1"
android:layout_marginEnd="24dp"/>
<View
android:id="@+id/v3"
android:layout_width="1dp"
android:layout_height="50dp"
android:background="@color/colorTimeline"
android:contentDescription="ad"
android:layout_marginStart="10dp"
android:layout_below="@id/v2"/>
最終出力: - 私はあなたのソリューションを見ると
Output Screenshot
xml用のものではなく、 – pskink