В моем макете у меня есть прокручиваемый вид с раскрывающимся списком внутри.Под расширяемым списком просмотра у меня есть кнопка.
Я хотел бы выровнять кнопку под последним элементом расширяемого списка.все нормально, когда разворачиваемое представление списка свернуто, потому что нижняя часть будет правильно выровнена внизу.При раскрытии кнопка теряет связь, потому что теперь последний элемент уже не последняя группа, а последний дочерний элемент.
<ScrollView xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/COSMainLayout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/scrollView"
android:fillViewport="false">
<android.support.constraint.ConstraintLayout
android:id="@+id/generale"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:focusableInTouchMode="true"
app:layout_constraintBottom_toTopOf="@+id/constraintLayoutButtons">
<!-- TITLE -->
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayoutTitolo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="0dp"
android:background="@color/primary_dark"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/riepilogoCantiere">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:gravity="center_horizontal"
android:text="@string/questionario_label_title"
android:textColor="@color/white"
android:textSize="@dimen/fontsize3"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<!-- QUESTIONS -->
<ExpandableListView
android:id="@+id/listadomande"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:choiceMode="none"
android:groupIndicator="@drawable/questionario_group_indicator"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayoutSottotitolo"
/>
<!-- BUTTONS -->
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayoutButtons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/listadomande">
<FrameLayout
android:id="@+id/divider_buttons"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="0dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="0dp"
android:background="@color/primary_dark"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<Button
android:id="@+id/invio"
style="@style/COSButtonIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/button_normal"
android:drawableStart="@drawable/ic_subdirectory_arrow_right_white_24dp"
android:paddingStart="15dp"
android:paddingEnd="25dp"
android:text="@string/questionario_button_label_invio"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/divider_buttons" />
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>
Большое спасибо