Android 在两个listview片段中的listview末尾添加边框

Android 在两个listview片段中的listview末尾添加边框,android,listview,android-fragments,Android,Listview,Android Fragments,正如标题所说,我有一个带有两个列表视图的片段,我想在第二个列表视图的末尾添加一个边框。我知道这通常是通过编写xml实现的: android:paddingBottom="50dp" android:clipToPadding="false" 当我只使用一个listView时,它可以很好地工作,但不能同时使用两个listView,我不知道为什么。 我已尝试在baseAdapter的getView中添加白色布局,但问题是我想管理我使用的长时间单击: listViewSin.setChoiceMod

正如标题所说,我有一个带有两个列表视图的片段,我想在第二个列表视图的末尾添加一个边框。我知道这通常是通过编写xml实现的:

android:paddingBottom="50dp"
android:clipToPadding="false"
当我只使用一个listView时,它可以很好地工作,但不能同时使用两个listView,我不知道为什么。 我已尝试在baseAdapter的getView中添加白色布局,但问题是我想管理我使用的长时间单击:

listViewSin.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE_MODAL);
listViewSin.setMultiChoiceModeListener(new AbsListView.MultiChoiceModeListener() {...});
在这种方法中,我无法知道在创建菜单之前单击的视图类型,因此我不想添加新视图

布局代码:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="10dip" >

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center_vertical"
            android:text="@string/sin"
            android:textColor="@color/black"
            android:textSize="15sp"
            android:id="@+id/android"/>

        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="#000000"
            />


        <ListView
            android:id="@+id/listView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dip"
            android:divider="@null"
            android:dividerHeight="0dp"
            android:background="#FFFFFF"/>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dip"
            android:gravity="center_vertical"
            android:text="@string/hechos"
            android:textColor="#A2A2A2"
            android:id="@+id/ios"/>
        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="#A2A2A2"
            />

        <ListView
            android:id="@+id/listView2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dip"
            android:background="#A2A2A2"
            android:divider="@null"
            android:dividerHeight="0dp"
            android:paddingBottom="80dp"
            android:clipToPadding="false"
            />

    </LinearLayout>

</ScrollView>
<android.support.design.widget.FloatingActionButton
    android:id="@+id/tareas_add"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:src="@drawable/add"
    android:layout_marginRight="10dp"
    android:layout_marginBottom="10dp"
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"
    android:layout_marginEnd="10dp" />


定义可绘制的形状,方法与此处所述类似:


将矩形的颜色设置为
列表视图的
背景色,将笔划的颜色设置为所需的底部边框颜色。然后在xml中,在
列表视图
元素背景属性中,使用@drawable/…

@HrundiV.Bakshi addedPlease引用形状!嵌套的可滚动视图是一个糟糕的设计!你不需要亲戚或线性布局——取决于你选择哪一个(我会选择RelativeLayout)。@HrundiV.Bakshi那么我该怎么办?(我对安卓系统有点陌生)首先了解一下在相对论中视图是如何相互关联的。然后了解利润率。这就是全部。