Могу ли я использовать Flow Helper с RadioButton? - PullRequest
1 голос
/ 10 июля 2019

Я нашел следующий пост на SO, касающийся помощников потока макета ограничений Пример помощника потока ConstraintLayout , и подумал, можно ли их использовать с переключателями.

Я мало что могу найти с помощью помощников потокав любом месте.

Я попытался добавить следующее в свой макет внутри RadioGroup.

    <androidx.constraintlayout.helper.widget.Flow
        android:id="@+id/flow1"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:padding="10dp"
        app:constraint_referenced_ids="radioButton, radioButton2, radioButton3"
        app:flow_horizontalBias="0"
        app:flow_horizontalGap="10dp"
        app:flow_horizontalStyle="packed"
        app:flow_verticalBias="0"
        app:flow_wrapMode="chain"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

При попытке запустить приложение я получаю следующие ошибки:

Android resource linking failed
C:\AndroidProjects\MyApp\app\src\main\res\layout\activity_main.xml:158: error: attribute flow_horizontalBias (aka com.domain.myapp:flow_horizontalBias) not found.
C:\AndroidProjects\MyApp\app\src\main\res\layout\activity_main.xml:158: error: attribute flow_horizontalGap (aka com.domain.myapp:flow_horizontalGap) not found.
C:\AndroidProjects\MyApp\app\src\main\res\layout\activity_main.xml:158: error: attribute flow_horizontalStyle (aka com.domain.myapp:flow_horizontalStyle) not found.
C:\AndroidProjects\MyApp\app\src\main\res\layout\activity_main.xml:158: error: attribute flow_verticalBias (aka com.domain.myapp:flow_verticalBias) not found.
C:\AndroidProjects\MyApp\app\src\main\res\layout\activity_main.xml:158: error: attribute flow_wrapMode (aka com.domain.myapp:flow_wrapMode) not found.
error: failed linking file resources.

1 Ответ

1 голос
/ 10 июля 2019

Использование constraintlayout:2.0.0-alpha5 в Gradle

См. Поток

...