android - Android Studio 3.1.x 中的 Constraint Layout Editor 是否已经支持 AndroidX?

标签 android android-studio android-constraintlayout androidx

我正在使用 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 Layout Editor

最佳答案

不可以,您需要使用 Android Studio 3.2 或 3.3

关于android - Android Studio 3.1.x 中的 Constraint Layout Editor 是否已经支持 AndroidX?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51920264/

相关文章:

android - constraintWidth_percent 计算不正确

android - 在保持 android :targetSdkVersion to be 14 的同时在 ICS 上显示菜单按钮

java - 如何在 Java 代码中使用 Parcelable

java - Box2d 不会使用 LibsGDX 和 Gradle 进行加载

android-studio - 有什么方法可以在使用远程桌面的同时在设备上调试 android 应用程序

android - 如何在 ConstraintLayout 中垂直或水平放置 View ?

android - 学习约束布局有问题

Android Sqlite SQLiteAbortException 不起作用

android - 将文件从 Assets 复制到数据文件夹后,数据未首次在 android 中显示

intellij-idea - 重新排列字段和常量