Линейный макет использует match_constraint в качестве layout_height.Я использую следующую функцию, чтобы «попытаться» получить высоту:
private int getHeightOfView(LinearLayout contentview) {
contentview.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
//contentview.getMeasuredWidth();
return contentview.getMeasuredHeight();
}
В итоге она возвращает высоту содержимого внутри (как если бы она имела layout_height: wrap_content ..что это точно не так).Любой совет или помощь будут высоко оценены, и я могу ответить на все, что я не указал в комментариях:)
РЕДАКТИРОВАТЬ: Это атрибуты, связанные с LinearLayout:
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_alignParentBottom="true"
android:layout_marginEnd="16dp"
android:layout_marginStart="50dp"
android:layout_marginTop="52dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.100000024">