1. 在约束布局中添加Button控件后,发现xml飘红了!
    AS4.1中ConstraintLayout中创建Button报错的解决办法
    2)报错信息为:“This view is not constrained, it only has designtime positions, so it will jump to (0,0)…”,以下为解决方案路径.将Text视图切换到Design,位于正中间,点击一下类似魔法棒的工具(Infer Constraints)即可.如下图所示:
    AS4.1中ConstraintLayout中创建Button报错的解决办法
  2. 点击Infer Constraints其实相当于在Button标签中添加如下两个属性:
    app:layout_constraintStart_toStartOf=“parent”
    app:layout_constraintTop_toTopOf=“parent”
    如下图所示:
    AS4.1中ConstraintLayout中创建Button报错的解决办法

相关文章:

  • 2022-01-26
  • 2021-10-08
  • 2021-12-08
  • 2022-02-04
  • 2022-02-25
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-12
  • 2021-10-12
  • 2021-09-08
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
相关资源
相似解决方案