gpt4 book ai didi

android - 左上角的 ConstraintLayout View

转载 作者:IT老高 更新时间:2023-10-28 22:02:43 49 4
gpt4 key购买 nike

每次我在 ConstraintLayout 中创建 ButtonTextView 之类的 View 时,它们都会卡在顶角而不是我放置它们的位置.

我尝试创建新 Activity 并更改模拟器,但结果仍然相同。

这是正在发生的事情的屏幕截图:

enter image description here

可能是什么问题?

最佳答案

Constraint Layout guides 中所述:

If a view has no constraints when you run your layout on a device, it is drawn at position [0,0] (the top-left corner).

You must add at least one horizontal and one vertical constraint for the view.

我猜你没有应用任何约束。

要么手动对 View 应用约束,要么让布局编辑器使用“推断约束”按钮为您完成:

enter image description here

关于android - 左上角的 ConstraintLayout View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42594033/

49 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com