Android - ExpandableListView内容在屏幕底部被截断

问题描述 投票:0回答:1

我是Android的新手,所以我可能只是做了一些愚蠢的事情,但这就是我的桌子看起来像:

我认为只是底部导航栏覆盖了内容,但当我在设备上测试它时,底部导航栏在设备而不是屏幕上我遇到了同样的问题。这是我的XML:

    <?xml version="1.0" encoding="utf-8"?>
<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=".TipActivity">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?android:attr/actionBarSize"
        android:background="?android:attr/colorPrimary"
        android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
        app:layout_constraintTop_toTopOf="parent"/>

    <ExpandableListView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/tip_list_view"
        app:layout_constraintTop_toBottomOf="@id/toolbar">
    </ExpandableListView>

</android.support.constraint.ConstraintLayout>
android xml expandablelistview android-constraintlayout
1个回答
0
投票

我发现了这个问题。通过将工具栏和ExpandableListView放在垂直线性布局中并使其他所有内容保持不变,视图正确匹配。

© www.soinside.com 2019 - 2024. All rights reserved.