这个很奇怪.我有一个列表视图,它是相对布局的一部分.我已为此相对布局设置了背景,并使列表视图背景变为透明.
现在,一切都很好,直到今天早上.即使我的列表视图中只有一行,我也可以看到整个屏幕都覆盖了我的自定义背景.
然后,我获得了Verizon Motorola Droid X for 2.3.3的更新(之前为2.2).一旦更新,我再次启动我的应用程序,现在发生了什么.
如果我的列表视图只有一行,我看到它下面有一个白色区域而不是我的自定义背景.但如果它说100行并因此覆盖整个屏幕我将不会看到奇怪的白色背景.我的相对布局的宽度和高度设置为"fill_parent".
我在底部发布了我的XML.有没有其他人遇到过这个问题,或者我犯了一些非常愚蠢的错误.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background = "@drawable/background"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView android:id = "@+id/listQueue"
android:layout_width = "fill_parent"
android:layout_height = "fill_parent"
android:layout_below = "@id/homeScreenBanner"
android:background="@android:color/transparent"
android:divider="@drawable/separator"
android:scrollingCache="false"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
编辑:
我想我找到了解决这个问题的方法:
将layout_height属性更改为wrap_content,它就像一个魅力.:)
更改后的行.
android:layout_height = "wrap_content"