1
在Android中,是否可以垂直對齊SwitchCompat,即將文本放在交換機上而不是交換機左側?Android SwitchCompat的垂直對齊?
在Android中,是否可以垂直對齊SwitchCompat,即將文本放在交換機上而不是交換機左側?Android SwitchCompat的垂直對齊?
你在找這樣的東西..?
試試這個
<LinearLayout
android:id="@+id/switchLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dp"
android:orientation="vertical">
<TextView
android:id="@+id/switchTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:text="Switch"/>
<Switch
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:rotation="90"
android:layout_margin="10dp"
android:layout_marginLeft="3dp"
android:id="@+id/switch1" />
</LinearLayout>
它看起來不像它。你可以用一個LinearLayout來包裝一個TextView和SwitchCompat來獲得你想要的結果。
我不需要旋轉開關,但我會記住它下一次。謝謝。 – u2gilles