內容不多,只是感覺平時很容易遇上,那就做個筆記吧!
其實很簡單,如下:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textSize="15dp"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:text="分類"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#999" />
<TextView
android:id="@+id/textView1"
android:layout_width="150dip"
android:layout_height="1dip"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/tv"
android:background="#999" />
<TextView
android:id="@+id/textView2"
android:layout_width="150dip"
android:layout_height="1dip"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/tv"
android:background="#999" />
</RelativeLayout>
效果:
字體大小,顏色都是可以修改的哦!覺得不錯同學點贊。