我正在使用 Android Studio 3.1.4。最近我将我的项目更新为 AndroidX。从那时起,Android Studio 中的布局编辑器似乎忽略了约束布局,并且不会在属性窗口中显示带有宽度/高度样式、边距和偏差控件的 View 检查器,如您所见here (第一组控制)。基本上我没有看到任何与约束布局相关的控件 - 例如带有按钮的工具栏可在编辑器中配置布局外观,如您所见here .我能够毫无问题地构建和运行该应用程序。我唯一的问题是我无法再通过布局编辑器更新我的布局。是否有人能够成功地将 AndroidX ConstraintLayout 与 Android Studio 布局编辑器结合使用?
build.gradle
// ...
android {
compileSdkVersion 28
buildToolsVersion '28.0.2'
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
}
// ...
}
dependencies {
//...
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
implementation 'androidx.constraintlayout:constraintlayout-solver:1.1.2'
//...
}
布局编辑器
最佳答案
不可以,您需要使用 Android Studio 3.2 或 3.3
关于android - Android Studio 3.1.x 中的 Constraint Layout Editor 是否已经支持 AndroidX?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51920264/