<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginBottom="10dp"
android:padding="5dp"
android:background="#fff3e0">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="坐标转换(GCJ-02→WGS-84)"
android:textSize="14sp"
android:textColor="#333333"/>
<Switch
android:id="@+id/switch_coordinate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:layout_marginStart="10dp"/>
</LinearLayout>
效果如下: