Android 开关不存在';t在比赛区的全视野内

Android 开关不存在';t在比赛区的全视野内,android,Android,我有以下代码 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_pare

我有以下代码

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="horizontal">

    <Switch
        android:id="@+id/switch1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:checked="true" />
</LinearLayout>

但情况如下


在这里,我想切换到全视图。我不知道我错过了什么。任何帮助都是非常值得欣赏的。

你试过运行你的代码吗?也试着设置
android:switchMinWidth=“yourwidth”
我不确定,但原因可能是android使用了一个可绘制的资源,它的宽度不会拉伸。你试过运行你的代码吗?也试着设置
android:switchMinWidth=“yourwidth”
我不确定,但原因可能是android使用的可绘制资源在宽度上没有延伸。