小编raq*_*zha的帖子

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

我在布局中使用的是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"/>
Run Code Online (Sandbox Code Playgroud)

这是androidx约束布局的示例屏幕截图: 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"/>
Run Code Online (Sandbox Code Playgroud)

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

这是错误还是什么?

编辑:

我当前的解决方案是从:

implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
Run Code Online (Sandbox Code Playgroud)

implementation 'com.android.support.constraint:constraint-layout:1.1.2'
Run Code Online (Sandbox Code Playgroud)

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

android android-constraintlayout constraint-layout-chains androidx

12
推荐指数
2
解决办法
2万
查看次数