codelab-constraint-layout
codelab-constraint-layout copied to clipboard
error message from barriers

Error Message from AS Missing Constraint in ConstraintLayout for activity_main_barriers.xml activity_main_chains.xml
_barriers.xml (with error)
<android.support.constraint.Barrier android:id="@+id/barrier3" android:layout_width="0dp" android:layout_height="wrap_content" app:barrierDirection="end" app:constraint_referenced_ids="settingsLabel,cameraLabel" tools:layout_editor_absoluteX="384dp" />
with setting the layout_width to
match_constraint and set the left and right side to 0 in the design view it work.
(It's not automatically and not in the documentation)
.xml "output" from the design
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
activity_main_chains.xml ID "cameraType" is constraint to the ID "cameraLabel" and not constraint to the barrier. barrierDirection is set on left
_chains.xml (with error)
<android.support.constraint.Barrier android:id="@+id/barrier" android:layout_width="0dp" android:layout_height="wrap_content" app:barrierDirection="start" app:constraint_referenced_ids="settings,cameraType" tools:layout_editor_absoluteX="72dp" />
delete barrier and constraint between cameraType and CameraLabel get new barrier, set layout_width to match_constraint, set the left and right side to 0
Hopefully it helps