首页 文章

xml中的WebView标记在Eclipse中显示错误

提问于
浏览
0

为什么布局xml文件拒绝WebView标记 . 带有十字的红色圆圈显示在xmlns行中:android =“http://schemas.android.com/apk/res/android”,无法启动应用程序 .

谢谢

1 回答

  • 0

    我猜您已将xmlns标记放在webview中,如下所示:

    <WebView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/imageView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    

    将其更改为

    <WebView
        android:id="@+id/imageView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    

    xmlns:android标记应该只添加到最外层的布局中 .

    至于为什么我们使用xmlns:android,阅读:Why this line xmlns:android="http://schemas.android.com/apk/res/android" must be the first in the layout xml file?

相关问题