我有下面的代碼: -對象引用不設置到對象的實例,同時初始化的WebView Xamarin的Android
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.layoutInformation);
WebView Body = FindViewById<WebView>(Resource.Id.BodyContentWV);-- Error here
// Create your application here
}
layoutInformation.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"
android:minWidth="25px"
android:minHeight="25px">
<android.webkit.WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/BodyContentWV" />
</LinearLayout>
我得到在初始化以下錯誤的WebView。任何人都可以指出任何Iam做錯了什麼?
System.NullReferenceException: Object reference not set to an instance of an object
什麼是有WebView的佈局的名稱? –
@ρяσѕρєяK其layoutInformation.xml – user3034944
@ρяσѕρєяK任何幫助? – user3034944