【发布时间】:2015-04-23 05:15:41
【问题描述】:
我有以下代码:-
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 时出现以下错误。谁能指出我做错了什么?
System.NullReferenceException: Object reference not set to an instance of an object
【问题讨论】:
-
有 WebView 的 Layout 的名称是什么?
-
@ρяσѕρєяK 它的 layoutInformation.xml