Android 当我拖放一个';ImageView';
我对Android studio非常陌生,但当我将Android 当我拖放一个';ImageView';,android,android-studio,Android,Android Studio,我对Android studio非常陌生,但当我将ImageView拖到屏幕上时,我从drawable中选择了我的图片,但随后出现了一个渲染错误,如下所示: The following classes could not be substantiated: - android.support.v7.widget.AppCombatImageView 知道问题出在哪里吗?ImageView在XML中看起来很好: <ImageView android:id="@+id/sho
ImageView
拖到屏幕上时,我从drawable中选择了我的图片,但随后出现了一个渲染错误,如下所示:
The following classes could not be substantiated:
- android.support.v7.widget.AppCombatImageView
知道问题出在哪里吗?ImageView
在XML中看起来很好:
<ImageView
android:id="@+id/shopCentre"
android:layout_width="120dp"
android:layout_height="64dp"
app:srcCompat="@drawable/shopping-centre"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="30dp"
android:layout_marginRight="8dp"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginLeft="8dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintHorizontal_bias="0.498" />
给我看看你的build.gradle文件使用android:src=“@drawable/shopping_center”而不是app:srccompate,谢谢@jaydeppatel
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}