【问题标题】:Overlay two listview with no transparency覆盖两个不透明的列表视图
【发布时间】:2012-06-30 22:30:33
【问题描述】:

我在框架布局上有两个列表视图。 我想要一个覆盖另一个,它没有透明背景。 我已经这样做了

    <FrameLayout  
    xmlns:android="http://schemas.android.com/apk/res/android"  
    android:layout_width="fill_parent"  
    android:layout_height="fill_parent">  


     <ListView
        android:id="@+id/autocompleteCompany"
        android:layout_width="100dip"
        android:layout_height="wrap_content"
        android:drawSelectorOnTop="true"
        android:paddingLeft="30dip"

         >

    </ListView>
  <ListView
      android:id="@+id/list"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" >
    </ListView>
</FrameLayout> 

但不能正常工作。 谢谢你

【问题讨论】:

    标签: android listview


    【解决方案1】:

    尝试使用&lt;RelativeLayout&gt; 而不是&lt;FrameLayout&gt;

    编辑:

    要摆脱透明度,您需要设置 listView 的背景颜色或 listView 适配器中的项目。这些问题将帮助您做到这一点:

    Changing background color of ListView items on Android

    listview item background color change

    【讨论】:

    • 您好,谢谢您的回答。嗨尝试相对布局,但结果相同。
    • 到底发生了什么?第二个列表没有覆盖另一个?还是其他问题?
    • 第二个列表与另一个列表重叠,但第一个的背景是透明的,它可以看到下面另一个列表视图的项目。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-07-21
    • 2011-09-27
    • 2012-02-05
    • 1970-01-01
    • 2013-02-25
    • 2011-08-27
    • 1970-01-01
    相关资源
    最近更新 更多