gpt4 book ai didi

androidx.constraintlayout.widget.constraintlayout 没有可以拖动的链

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:22:28 25 4
gpt4 key购买 nike

我在我的布局中使用 androidx.constraintlayout.widget.ConstraintLayout 并且它不显示链,我也不能拖动任何小部件。我只需键入要使用的约束。

<androidx.constraintlayout.widget.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="112dp"/>

这是 androidx constraintLayout 的示例屏幕截图: androidx.constraintlayout.widget.ConstraintLayout

但是当我尝试切换回:android.support.constraint.ConstraintLayout 我可以看到它

<android.support.constraint.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="112dp"/>

这里是支持 constraintLayout 的示例屏幕截图: android.support.constraint.ConstraintLayout

这是一个错误还是什么?

编辑:

我目前的解决方案是从:

implementation 'androidx.constraintlayout:constraintlayout:1.1.2'

implementation 'com.android.support.constraint:constraint-layout:1.1.2'

但这并不能解决我的问题,因为我不想使用支持。

最佳答案

我遇到了同样的问题,直到我意识到我应该使用 Canary 版本来解决它。在稳定版本旁边安装 Canary 版本后,打开项目,现在你可以使用这个实现:

implementation 'androidx.constraintlayout:constraintlayout:1.1.2'

代替

implementation 'com.android.support.constraint:constraint-layout:1.1.2'

请记住,您可能需要执行以下操作:

  • 清理项目
  • 重建
  • 使缓存无效/重新启动

我的问题用这个方法解决了。

关于androidx.constraintlayout.widget.constraintlayout 没有可以拖动的链,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51146885/

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