【问题标题】:Android: Spacer between 2 ListviewsAndroid:2个列表视图之间的间隔
【发布时间】:2012-06-04 04:06:36
【问题描述】:

如何在两个列表视图之间添加 20px 的空间:

    <ListView
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/listStations" />
 SPACER???
    <ListView
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/listSocial" />

【问题讨论】:

    标签: android listview padding


    【解决方案1】:

    ListViews 之一上将paddingToppaddingBottom 设置为20px 就足够了。或者,您可以创建一个空视图(例如,没有文本的 TextView,或者 @AljoshaBre 提到的只是一个 View),并将其 layout_height 设置为 20px

    【讨论】:

      【解决方案2】:

      对于你可以添加的第一个列表视图

       android:layout_marginBottom="20dp"
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多