【发布时间】: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