我有下面的代码: -对象引用不设置到对象的实例,同时初始化的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