我将 BottomNavigationView 用于底栏,并在一个活动中显示 listView 中的对象列表。但是我应用于该活动的底栏阻碍了 listView 的最后一个元素。
从图像中可以看出,最后一个列表元素被底栏挡住了(最后一个元素所在的城市不可见)。
如何解决这个问题并在没有底栏干预的情况下正确显示列表元素。这是xml代码:
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.vendorapp.Promotion">
<RelativeLayout
android:id="@+id/mainrlot"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/cust_dtl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="invisible">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Customer List"
android:textColor="#000000"
android:textSize="30sp" />
<ListView
android:id="@+id/cstmrListView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@android:color/transparent"
android:stackFromBottom="false"
android:transcriptMode="alwaysScroll"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="24dp"
tools:listitem="@layout/customer_list" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="end of result"
android:textSize="20sp"/>
</LinearLayout>
</RelativeLayout>
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="0dp"
android:layout_marginStart="0dp"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/navigation" />
</android.support.constraint.ConstraintLayout>