Я пытаюсь использовать макет ограничения для настраиваемого диалогового окна оповещения (бог знает почему, у меня всегда возникают с ними проблемы), и я не могу заставить представление отображать что-либо, если нет хотя бы ОДНОГО элемента, который layout_heightустановлен для переноса содержимого и НЕ соответствует ограничению.Ниже мой 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">
<Spinner
android:id="@+id/shapeSpinner"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toTopOf="@+id/gH3"
app:layout_constraintEnd_toStartOf="@+id/gV2"
app:layout_constraintStart_toStartOf="@+id/gV1"
app:layout_constraintTop_toTopOf="@+id/gHBreak">
</Spinner>
<android.support.constraint.Guideline
android:id="@+id/guidelineSideLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.05" />
<android.support.constraint.Guideline
android:id="@+id/guidelineSideRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.95" />
<android.support.constraint.Guideline
android:id="@+id/gH1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.1" />
<android.support.constraint.Guideline
android:id="@+id/gH2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.2" />
<android.support.constraint.Guideline
android:id="@+id/gHBreak"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.25" />
<android.support.constraint.Guideline
android:id="@+id/gH3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.35" />
<android.support.constraint.Guideline
android:id="@+id/gH4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.45" />
<android.support.constraint.Guideline
android:id="@+id/gH5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.55" />
<android.support.constraint.Guideline
android:id="@+id/gEnd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.60" />
<android.support.constraint.Guideline
android:id="@+id/gV1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.35" />
<android.support.constraint.Guideline
android:id="@+id/gV2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.65" />
<CheckBox
android:id="@+id/shapeCheckBox"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="Shape"
app:layout_constraintBottom_toTopOf="@+id/gH1"
app:layout_constraintEnd_toStartOf="@+id/gV1"
app:layout_constraintStart_toStartOf="@+id/guidelineSideLeft"
app:layout_constraintTop_toTopOf="parent" />
<CheckBox
android:id="@+id/colourCheckBox"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="Colour"
app:layout_constraintBottom_toTopOf="@+id/gH1"
app:layout_constraintEnd_toStartOf="@+id/gV2"
app:layout_constraintStart_toStartOf="@+id/gV1"
app:layout_constraintTop_toTopOf="parent" />
<CheckBox
android:id="@+id/radiusCheckBox"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="Radius"
app:layout_constraintBottom_toTopOf="@+id/gH1"
app:layout_constraintEnd_toStartOf="@+id/guidelineSideRight"
app:layout_constraintStart_toStartOf="@+id/gV2"
app:layout_constraintTop_toTopOf="parent" />
<CheckBox
android:id="@+id/lWCheckBox"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="Width/Height"
app:layout_constraintBottom_toTopOf="@+id/gH2"
app:layout_constraintEnd_toStartOf="@+id/gV1"
app:layout_constraintStart_toStartOf="@+id/guidelineSideLeft"
app:layout_constraintTop_toTopOf="@+id/gH1" />
<CheckBox
android:id="@+id/lengthCheckBox"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="Length"
app:layout_constraintBottom_toTopOf="@+id/gH2"
app:layout_constraintEnd_toStartOf="@+id/gV2"
app:layout_constraintStart_toStartOf="@+id/gV1"
app:layout_constraintTop_toTopOf="@+id/gH1" />
<TextView
android:id="@+id/shapesText"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="Shape"
android:textAlignment="center"
android:textSize="24sp"
app:layout_constraintBottom_toTopOf="@+id/gH3"
app:layout_constraintEnd_toStartOf="@+id/gV1"
app:layout_constraintStart_toStartOf="@+id/guidelineSideLeft"
app:layout_constraintTop_toTopOf="@+id/gHBreak" />
<TextView
android:id="@+id/colourText"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="Colour"
android:textAlignment="center"
android:textSize="24sp"
app:layout_constraintBottom_toTopOf="@+id/gH4"
app:layout_constraintEnd_toStartOf="@+id/gV1"
app:layout_constraintStart_toStartOf="@+id/guidelineSideLeft"
app:layout_constraintTop_toTopOf="@+id/gH3" />
</android.support.constraint.ConstraintLayout>
И изображение:
А вот где вид завышен:
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
LayoutInflater inflater = this.getLayoutInflater();
View dialogView = inflater.inflate(R.layout.filter,null);
dialogBuilder.setView(dialogView);
AlertDialog alertDialog = dialogBuilder.create();
alertDialog.show();
И вот как это выглядитнапример, когда я запускаю его:
Что я делаю не так?У меня есть
compile 'com.android.support.constraint:constraint-layout:1.1.0'
в соответствии с моим файлом build.gradle.