ConstraintLayout子View android:minHeight 无效解决

当父类是ConstraintLayout时
子view设置

	 android:layout_height="wrap_content"
	 android:minHeight="40dp"

无效,疑似为自定义View没有做minHeight的适配,TextView如此写就可以实现最小高度的限制
但是如下设置,则可以实现最小高度的效果

	android:layout_height="wrap_content"
	app:layout_constrainedHeight="true"
	app:layout_constraintHeight_min="40dp"

同理宽度只要将height换成width即可
最大宽度/高度效果应该也可以这样实现

app:layout_constraintHeight_max

我没测试,请自己尝试看下

你可能感兴趣的:(Android)