Android 是否显示以设置文本在SwitchCompat处于关闭状态时可见?
目前,我的Android 是否显示以设置文本在SwitchCompat处于关闭状态时可见?,android,switchcompat,Android,Switchcompat,目前,我的SwitchCompat看起来像下图(顶部),但是我需要在关闭状态下显示可见文本 我将如何实现这一点 您使用的是背景图像吗?如果需要,您需要在图像上设置文本而不是打开开关。 <android.support.v7.widget.SwitchCompat android:id="@+id/autoLocation" android:layout_width="match_parent" android:layout_height
SwitchCompat
看起来像下图(顶部),但是我需要在关闭状态下显示可见文本
我将如何实现这一点
您使用的是背景图像吗?如果需要,您需要在图像上设置文本而不是打开开关。
<android.support.v7.widget.SwitchCompat
android:id="@+id/autoLocation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@color/colorPrimary"
android:checked="false"
android:paddingBottom="10dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="10dp"
android:text="@string/autoLocation"
android:textColor="#ffffff"
android:textOff="Off"
android:textOn="On"
android:textSize="20sp"
app:showText="true" />
我不会在图像上使用它,因为我以后需要本地化应用程序