【问题标题】:Why do the views not move?为什么观点不动?
【发布时间】:2021-08-09 14:05:19
【问题描述】:

this is the picture after i edit comment为什么视图不动?

我收到标题错误:此视图不受限制。它只有设计时位置,所以它会在运行时跳转到 (0,0),除非你添加约束,我尝试使用推断约束,但它不起作用

【问题讨论】:

  • ConstraintLayout 的概念是用于不使用固定 DP。所以你需要学习约束。喜欢把图片放在中心使用app:layout_constraintEnd_toEndOf="parent"app:layout_constraintStart_toStartOf="parent"app:layout_constraintTop_toTopOf="parent"app:layout_constraintBottom_toBottomOf="parent"在你ImageView

标签: java android constraints


【解决方案1】:
  1. 申请Clear all constraints

  1. 移动图像。

  2. 申请Infer Constraints

【讨论】:

  • 移动不起作用?还是图像视图?请分享你的xml
  • 是的,我确实编辑了评论并添加了一张图片
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-23
  • 2011-04-19
  • 2015-09-28
  • 2023-01-30
  • 2011-04-04
相关资源
最近更新 更多