Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/219.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 相对长度填充高度';无法在项目列表视图布局中工作_Android_Android Layout - Fatal编程技术网

Android 相对长度填充高度';无法在项目列表视图布局中工作

Android 相对长度填充高度';无法在项目列表视图布局中工作,android,android-layout,Android,Android Layout,我有相对布局的项目列表视图布局,但当我设置了“填充父项”高度时,它似乎没有填充,如何使它 这个 这里的问题是,线性布局不是填充高度,而是宽度没有问题 <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_centerInParent="true" android:layout_m

我有相对布局的项目列表视图布局,但当我设置了“填充父项”高度时,它似乎没有填充,如何使它

这个


这里的问题是,线性布局不是填充高度,而是宽度没有问题

<LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_centerInParent="true"
        android:layout_margin="4dp"        
        android:background="@drawable/inbox_interface" >

如果它是在电话上运行的,即使像这样

视图看起来就像一条黑线

但我想看起来像这样

抱歉,在代码(或适配器)中出现了我的英语

,您可以尝试此操作,获取屏幕高度,并将线性布局或相对布局的最小高度设置为您获得的高度


要获得屏幕的高度,请遵循

无需在列表项中设置android:layout\u height=“match\u parent”。对不起,我编辑了我的问题,高度是fill\u parent,但不起作用列表知道它的宽度,但高度未知,所以大多数时候忽略了match\u parent<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_centerInParent="true" android:layout_margin="4dp" android:background="@drawable/inbox_interface" >