你命名空间全是tools,tools是预览用的,实际不起效。ConstraintLayout应该用app
xmlns:app="http://schemas.android.com/apk/res-auto"
app:layout_constraintLeft_toLeftOf="parent"
约束布局需要指定他的父布局,先学习约束布局吧: