渲染问题和ImageView

问题描述 投票:-1回答:1

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

  1. 渲染问题(activity_main
  2. 命令Aapt2.exe具有非零退出代码值1
  3. ImageView srcCompat错误。

我该怎么办?

android android-appcompat src aapt aapt2
1个回答
0
投票

使用AppCompatImageView而不是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
    }
 }
© www.soinside.com 2019 - 2024. All rights reserved.