2011-07-17 72 views
0

首先,對不起我的英文不好! 我是新來的,我是Android應用開發者的初學者!和我有一個問題:Android:「忽略錯誤日誌中的未知'WebView'XML元素」消息

它的main.xml:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
    <TextView 
     android:id= "@+id/txtv"  
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="@string/hello"/> 
    <WebView 
     android:id="@+id/webv" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"/> 
    <LinearLayout 
     android:orientation="horizontal" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 
     <Button 
      android:id = "@+id/backButton" 
      android:text="@string/bText" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"/> 
     <Button 
      android:id = "@+id/forwardButton" 
      android:text="@string/fText" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"/> 
     > 
    </LinearLayout> 
    > 
</LinearLayout> 

但是當我調試我的應用程序將在錯誤日誌窗口中顯示此錯誤:

AndroidManifest: Ignoring unknown 'WebView' XML element 

編輯:問題解決,上面的代碼被修改和正確的代碼!

+0

您是否想要在webview上加載html數據或者您想要在webview上加載url? – Sumant

+0

@Sumant - 沒有什麼與INTERNET權限相關的,如果你認爲缺少... – evilone

+0

@Sumat - 我想在webview的資產文件夾中加載html頁面。 –

回答

0

移除的WebView xmlns:android="http://schemas.android.com/apk/res/android"的這部分代碼並添加android:layout_widthandroid:layout_height屬性的按鈕。

+0

非常感謝。我做到了,但結果相同!任何其他幫助! –

+0

編輯我的答案 – evilone

+0

@ evilone:不需要android.webkit.WebView在xml文件中WebView標記將出現 – Sumant