...
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.android.constraintlayoutexamples.MainActivity">
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:id="@+id/button"
...
android:text="@string/centering_views"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_constraintLeft_creator="1"
tools:layout_constraintRight_creator="1" />
...
by @androhi 12