【问题标题】:Rendering problems and ImageView渲染问题和 ImageView
【发布时间】:2019-02-23 14:03:29
【问题描述】:

当我在 Android 中创建新项目时。我收到错误:

  1. 渲染问题 (activity_main)

  2. 命令 Aapt2.exe 具有非零退出代码值 1

  3. ImageView srcCompat 错误。

我该怎么办?

【问题讨论】:

  • 改进了格式,添加了android标签

标签: android android-appcompat src aapt aapt2


【解决方案1】:

使用 AppComapatImageView 代替 ImageView

<android.support.v7.widget.AppCompatImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:srcCompat="@drawable/circle_icon" />

将此添加到 gradle.refer this

android {
   defaultConfig {
     vectorDrawables.useSupportLibrary = true
    }
 }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-01-27
    • 1970-01-01
    • 1970-01-01
    • 2023-03-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多