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