更新的Android SDK和Android Studio搞砸了我的所有XML:"此处不允许使用元素XXX"

Vla*_*ncu 6 xml android

我刚刚更新了我的Android Studio和Android SDK,现在我无法在我的XML中做任何事情.它显示了与之前相同的东西,但我无法添加任何东西,而且有些东西搞砸了.

例:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
    <ImageView
        android:id="@+id/bocterAppLogo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:src="@drawable/bocterapp"
        android:contentDescription=""/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

它错误地说:"这里不允许使用Element ImageView".

你知道为什么会这样吗?

干杯!

pro*_*ade 4

我有同样的问题。尝试将 ImageView 与 android.support.v7.widget.AppCompatImageView 交换!这为我解决了。