Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/186.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
androidx.constraintlayout.widget.constraintlayout don';我没有可以拖拽的链条_Android_Android Constraintlayout_Constraint Layout Chains_Androidx - Fatal编程技术网

androidx.constraintlayout.widget.constraintlayout don';我没有可以拖拽的链条

androidx.constraintlayout.widget.constraintlayout don';我没有可以拖拽的链条,android,android-constraintlayout,constraint-layout-chains,androidx,Android,Android Constraintlayout,Constraint Layout Chains,Androidx,我在布局中使用了androidx.constraintlayout.widget.constraintlayout,它不显示链,也不能拖动任何小部件。我只需键入要使用的约束 <androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"

我在布局中使用了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"/>


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

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

implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
而不是

implementation 'com.android.support.constraint:constraint-layout:1.1.2'
请记住,您可能需要执行以下操作:

  • 清洁工程
  • 重建
  • 使缓存无效/重新启动

使用此方法解决了我的问题。

如果您使用的是最新的Android update 3.3.3,请从支持约束布局迁移到Android x:

<android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

要获取此信息,请更改gradle:

实现com.android.support.constraint:约束布局:1.1.3


实现androidx.constraintlayout:constraintlayout:2.0.0-alpha3

遇到这种情况时,我正在使用金丝雀版本。我意识到这可能是因为在“金丝雀”版本中,我们遇到了更多的bug,bug可以自行修复。我将我的Android Studio更新为3.3 Canary 6,现在它的workingClean项目就是我所要做的
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
<android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>