簡體   English   中英

Android Xamarin在Android.Widget中沒有WebView

[英]Android Xamarin no WebView in Android.Widget

我試圖在Xamarin中將Vebview添加到我的應用中,並在其中添加了一個帶Webview的.axml

axml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minWidth="25px"
android:minHeight="25px">
<WebView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/LocalWebView" />

但是,當我打開MainActivity.cs並嘗試添加行時:

SetContentView(Resource.Layout.Kaamera);
WebView WV = FindViewById<WebView>(Resource.Id.LocalWebView);

我收到2個錯誤:

嚴重性代碼說明項目文件行抑制狀態錯誤CS0246找不到類型或名稱空間名稱'WebView'(您是否缺少using指令或程序集引用?)[MainActivity.cs的路徑] 54有效

嚴重性代碼說明項目文件行抑制統計錯誤CS0246找不到類型或名稱空間名稱'WebView'(您是否缺少using指令或程序集引用?)[MainActivity.cs的路徑]有效

如果要使用Webview,則需要在yout代碼的開頭添加以下幾行。

using Android.Webkit;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM