1

ConstraintLayout is new in android so anybody know what is tools:layout_constraintBaseline_creator="0" and what purpose does it serve to the attributes. Below is my code.

<Button
        android:text="Button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        tools:layout_editor_absoluteX="144dp"
        tools:layout_editor_absoluteY="39dp"
        android:id="@+id/button2"
        app:layout_constraintLeft_toRightOf="@+id/button"
        android:layout_marginLeft="40dp"
        android:layout_marginStart="40dp"
        tools:layout_constraintLeft_creator="0"
        app:layout_constraintBaseline_toBaselineOf="@+id/button"
        tools:layout_constraintBaseline_creator="0" />
pRaNaY
  • 24,642
  • 24
  • 96
  • 146

1 Answers1

1

This attribute is used only for the editor. tools: attributes are stripped from the code and are only for development purposes.

I'm not sure what layout_constraintBaseline_creatoris about but my gut says that the layout editor ONLY generates it when a constraint is created. ConstraintLayout is not yet documented.

Nikola Despotoski
  • 49,966
  • 15
  • 119
  • 148
  • 5
    The "creator" attribute is used to know who created the constraint (you, auto inference, auto connect, etc.). It allows the designer to "remember" what you did and act accordingly to avoid surprises (for instance when you click auto inference, the editor won't destroy the constraints you created). – Romain Guy Jun 21 '16 at 22:55
  • It would be great to document this somewhere. – Sky Kelsey Nov 17 '16 at 05:44
  • 2
    @RomainGuy it would be great to be able to stop generating these, as well as the layout_edit_absoluteX, Y etc for people that want to work with the xml directly and not with the visual editor – sakis kaliakoudas Apr 08 '17 at 07:56