Differences between ConstraintLayout and RelativeLayout
问题 I am confused about the difference between ConstraintLayout and RelativeLayout . Could someone please tell me the exact differences between them? 回答1: Intention of ConstraintLayout is to optimize and flatten the view hierarchy of your layouts by applying some rules to each view to avoid nesting. Rules remind you of RelativeLayout , for example setting the left to the left of some other view. app:layout_constraintBottom_toBottomOf="@+id/view1" Unlike RelativeLayout , ConstraintLayout offers