androidxへのmigrateでConstraintLayout内のlayoutが崩れた時

androidxへmigrateしたことが影響したのかConstraintLayout内でlayoutが崩れたのでメモ。

 <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/timeline_radius_topright"
            app:layout_constraintEnd_toEndOf="@id/background"
            app:layout_constraintTop_toTopOf="@id/background"/>

右上に居てほしいが左上に居る。 f:id:chiiia12:20190526115240j:plain

 <ImageView
            android:id="@+id/radius_topright"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/timeline_radius_topright"
            app:layout_constraintEnd_toEndOf="@id/background"
            app:layout_constraintTop_toTopOf="@id/background"/>

結局idをつけることで期待通りのレイアウトになった。そうなのか…

f:id:chiiia12:20190526115249j:plain

ref:

ConstraintLayout  |  Android Developers