我們的ImageView居中了,沒錯(cuò),如果添加app:layout_constraintRight_toRightOf="parent"和app:layout_constraintLeft_toLeftOf="parent"會(huì)水平居中,添加app:layout_constraintLeft_toLeftOf="parent"和app:layout_constraintRight_toRightOf="parent"會(huì)豎直居中,全部添加就是水平和豎直方向都居中。
豎直居中的屬性寫錯(cuò)了。應(yīng)該是top和bottom
ConstraintLayout使用指南本文已授權(quán)微信公眾號(hào):碼個(gè)蛋 在微信公眾號(hào)平臺(tái)原創(chuàng)首發(fā) 前言 ConstraintLayout是2016年Google的I/O大會(huì)推出的新型布局-約束布局,話說,今年都201...