Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Emulator:此主屏幕上没有更多空间_Android - Fatal编程技术网

Android Emulator:此主屏幕上没有更多空间

Android Emulator:此主屏幕上没有更多空间,android,Android,我的应用程序发生了一些问题,因为我无法将小部件放置在模拟器中。它说:这个主屏幕上没有更多的空间。我试图修改布局宽度参数,但没有任何改变。有什么想法吗 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layou

我的应用程序发生了一些问题,因为我无法将小部件放置在模拟器中。它说:这个主屏幕上没有更多的空间。我试图修改布局宽度参数,但没有任何改变。有什么想法吗

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="200px"
    android:layout_height="100px"
    android:layout_gravity="left"
    android:id="@+id/widgetlayout"
    android:background="@drawable/blacktrans"
    >

  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="horizontal"
       android:layout_width="200px"
        android:layout_height="20dip"
        android:id="@+id/widgetlayoutinside3"
        android:paddingTop="3px"
        android:layout_marginLeft="5px"
        >
        <TextView android:id="@+id/widget_textview3"
            android:text="widget_text"
            android:layout_height="wrap_content"
            android:layout_width="70px"
            android:textColor="#FFFFFF"
            android:textSize="13sp"
            android:paddingLeft="15px"
            android:layout_gravity="fill_horizontal"
            android:layout_marginLeft="5px"
            />
        <Button 
            android:id="@+id/ButtonP3" 
            android:layout_width="28px" 
            android:layout_height="28px"
            android:layout_toRightOf="@+id/widget_textview3"
            android:layout_marginLeft="5px">
        </Button>
        <Button
            android:id="@+id/ButtonS3" 
            android:layout_width="28px" 
            android:layout_height="28px"
            android:layout_marginLeft="5px"
            android:layout_toRightOf="@+id/ButtonP3">
        </Button>
        <Button 
            android:id="@+id/ButtonM3" 
            android:layout_width="28px" 
            android:layout_height="28px"
            android:layout_marginLeft="5px"
            android:layout_toRightOf="@+id/ButtonS3">
        </Button>
    </RelativeLayout>
</RelativeLayout>

若屏幕上有太多的图标,而你们的小部件太大,你们就无法放置它。我认为您必须移动图标并制作更小的小部件。

再次阅读关于小部件宽度的部分


我建议您使用标准尺寸,并试着看看它对您的效果。

小部件屏幕尺寸为每个单元格纵向倾斜80x100y,横向倾斜106x74y。您需要确保您的小部件可以静态地符合该大小,也可以动态地分配给它,即fill_parent

尝试在模拟器上滑动到一个空的主屏幕并将其放在那里。天哪,为什么您认为我将小部件放在一个空间不够的小地方是如此愚蠢?屏幕上什么都没有,什么都没有哈哈,有很多人犯了这个错误。