Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.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
Xamarin Android:使用ScrollView会使小部件无法工作_Android_Xamarin_Widget - Fatal编程技术网

Xamarin Android:使用ScrollView会使小部件无法工作

Xamarin Android:使用ScrollView会使小部件无法工作,android,xamarin,widget,Android,Xamarin,Widget,我一直在尝试使用Xamarin开发简单的Android小部件 使用包含内容的LinearLayout时: <LinearLayout xmlns:p1="http://schemas.android.com/apk/res/android" p1:orientation="vertical" p1:layout_width="match_parent" p1:layout_height="wrap_content" p1:id="@+id/linearLay

我一直在尝试使用Xamarin开发简单的Android小部件

使用包含内容的LinearLayout时:

<LinearLayout xmlns:p1="http://schemas.android.com/apk/res/android"
    p1:orientation="vertical"
    p1:layout_width="match_parent"
    p1:layout_height="wrap_content"
    p1:id="@+id/linearLayout1"
    p1:minWidth="25px"
    p1:minHeight="25px">
    <Button
        p1:text="Button"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/button1" />
</LinearLayout>

一切正常,但当然,当我添加例如10个按钮时,我无法滚动我的小部件来访问每个按钮

添加滚动视图时:

<LinearLayout xmlns:p1="http://schemas.android.com/apk/res/android"
    p1:orientation="vertical"
    p1:layout_width="match_parent"
    p1:layout_height="wrap_content"
    p1:id="@+id/linearLayout1"
    p1:minWidth="25px"
    p1:minHeight="25px">
    <ScrollView
        p1:minWidth="25px"
        p1:minHeight="25px"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/scrollView1">
        <LinearLayout
            p1:orientation="vertical"
            p1:minWidth="25px"
            p1:minHeight="25px"
            p1:layout_width="match_parent"
            p1:layout_height="match_parent"
            p1:id="@+id/linearLayout2">
            <Button
                p1:text="Button"
                p1:layout_width="match_parent"
                p1:layout_height="wrap_content"
                p1:id="@+id/button1" />
        </LinearLayout>
    </ScrollView>
</LinearLayout>

我的小部件无法运行(
加载小部件时出现问题


我还没有添加任何后端代码。如何解决我的问题?

添加生成的错误,如果没有这些信息,将无法提供帮助。如何访问错误?在我的手机上运行widget时,我在加载widget时只遇到了
问题尝试调试你的应用程序并查看输出,否则使用android SDK上的监视器工具并从你的应用程序中查找消息