I want to build the following layout using ConstraintLayout:
I use this source for layout:
<
The first two answer will work. You can also add app:layout_constraintVertical_chainStyle="spread_inside" to the top ImageView if you want to maintain your vertical chain.
Here is an image after adding this statement (but not changing anything else.)
Here is the XML:
Update: So the above doesn't work on API 23 with ConstraintLayout version 1.0.2. Try the following instead:
Remove android:layout_marginTop="16dp" from textView2 and add android:layout_marginBottom="16dp" to textView1. This makes a difference.