效果如上图:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/rl"
android:orientation="horizontal"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:gravity="center"
>
<!--画左边的那条线-->
<View
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_weight="1"
android:background="@android:color/darker_gray"
/>
<TextView
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="其他登录方式"
android:textColor="@android:color/white"
/>
<!--画右边的那条线-->
<View
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_weight="1"
android:background="@android:color/darker_gray"
/>
</LinearLayout>