Answer the question
In order to leave comments, you need to log in
How to place LIstView along with other elements so that everything fits?
The question is asked as crookedly as possible, but the toaster wants there to be a question mark ...
The bottom line is, there is an activity, where there are only two elements, the code is this:
<?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"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
tools:context=".WorkOrdersList">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar_actionbar"
android:layout_width="match_parent"
android:layout_height="?android:actionBarSize"
android:background="?attr/colorAccent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:theme="@style/AppTheme.AppBarOverlay"
app:layout_constraintTop_toTopOf="parent" />
<ListView
android:id="@+id/WorkOrdersList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar_actionbar"
app:layout_constraintVertical_bias="0.0" />
</android.support.constraint.ConstraintLayout>
Answer the question
In order to leave comments, you need to log in
in ConstraintLayout instead match_parent
should be used 0dp
- this means that all the allowed space given by the constraints will be used
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question