Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 当我添加按钮时,我的Xamarin应用程序崩溃_Android_Xamarin_Webview - Fatal编程技术网

Android 当我添加按钮时,我的Xamarin应用程序崩溃

Android 当我添加按钮时,我的Xamarin应用程序崩溃,android,xamarin,webview,Android,Xamarin,Webview,在我添加按钮或进度条之前,我的原生Xamarin WebView应用程序工作正常。如果我取消注释下面代码中的一个控件,应用程序将在启动时崩溃。我做错了什么 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientati

在我添加按钮或进度条之前,我的原生Xamarin WebView应用程序工作正常。如果我取消注释下面代码中的一个控件,应用程序将在启动时崩溃。我做错了什么

<?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">

    <!--
    <Button
        android:layout_weight="34" 
        android:layout_width="0dip"
        android:layout_height="wrap_content" 
        android:orientation="vertical"
        android:text="Home"
        android:id="@+id/btnHome" />
    -->

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/relativeLayout1">
        <!--<ProgressBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:visibility="invisible"
            android:id="@+id/progressBar1" />-->

        <android.webkit.WebView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/webView1" />
    </RelativeLayout>

</LinearLayout>


好吧,我所做的只是从头开始创建一个新项目,并复制了我所有的代码,效果很好。所以,我想,在我依赖的地方,我把事情搞砸了。但这在一个新项目中有效。

您检查过输出日志了吗,在“视图”->“输出”下,崩溃时它会显示相同的日志以及详细信息,请共享以更好地理解。