ConstraintLayout中TextView文字超过屏幕问题

问题:超出屏幕布局如下图,是右边红框的view
下图是已修复的布局
ConstraintLayout中TextView文字超过屏幕问题_第1张图片

解决方式:

    
  1. 将宽度设置成0dp
  2. 加入app:layout_constraintHorizontal_weight="1"
  3. 右侧这时候用layout_constraintRight_toRightOf="parent"

这时候加android:layout_marginRight这种属性就起作用了,显示也正常了,不会超出右侧屏幕。

你可能感兴趣的:(学习总结)