Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/305.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/225.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
C# 与错误膨胀类android.widget.TimePicker相关的问题_C#_Android_.net_Xamarin - Fatal编程技术网

C# 与错误膨胀类android.widget.TimePicker相关的问题

C# 与错误膨胀类android.widget.TimePicker相关的问题,c#,android,.net,xamarin,C#,Android,.net,Xamarin,当我调试我的应用程序时,当我点击带有时间选择器的按钮时,我遇到了问题 发生错误 二进制XML文件行#20:二进制XML文件行#20:对类android.widget.TimePicker进行膨胀时出错 有人能帮我解决这个问题吗 这是我的XML代码: <Label Text="Godzina" Grid.Column="3" Grid.ColumnSpan="3" Grid.Row="8" TextColor="Black" Font="Bold,14"></Label>

当我调试我的应用程序时,当我点击带有时间选择器的按钮时,我遇到了问题 发生错误

二进制XML文件行#20:二进制XML文件行#20:对类android.widget.TimePicker进行膨胀时出错

有人能帮我解决这个问题吗 这是我的XML代码:

<Label Text="Godzina" Grid.Column="3" Grid.ColumnSpan="3"  Grid.Row="8"  TextColor="Black" Font="Bold,14"></Label>
                    <TimePicker x:Name="StartHour"
                Format="T" Grid.Row="9" Grid.ColumnSpan="3"  BindingContext="{Binding StartHour}" HorizontalOptions="FillAndExpand">
                    </TimePicker>
                    <TimePicker x:Name="EndHour"
                Format="T" Grid.Row="9" Grid.ColumnSpan="3" BindingContext="{Binding EndHour}"  Grid.Column="3"  HorizontalOptions="FillAndExpand">
                    </TimePicker>
            <Label Text="Miejsce spotkania" Grid.Row="10" Grid.ColumnSpan="6"  TextColor="Black" Font="Bold,14"></Label>
                    <controls:CustomEntry x:Name="Place" Grid.ColumnSpan="6" Text="{Binding Place}" Grid.Row="11"></controls:CustomEntry>
            <Label Text="Przypomnienie" Grid.Row="12" Grid.ColumnSpan="6"  TextColor="Black" Font="Bold,14"></Label>
                    <TimePicker x:Name="Reminder"
                Format="T" Grid.Row="13" BindingContext="{Binding Reminder}" Grid.ColumnSpan="6"  HorizontalOptions="FillAndExpand">
                    </TimePicker>
                    <Button x:Name="MakeMeeting"  Command="{Binding CreateCommand}" Text="Stworz spotkanie" Grid.ColumnSpan="6"   BackgroundColor="#034ad7" BorderRadius="14" TextColor="FloralWhite" HeightRequest="50" VerticalOptions="Start" Grid.Row="14"></Button>


我发现的原因是时间选择器不能与ScrollView一起工作,这是一个bug,如何解决它

根据我的测试,我们可以在ScorelView中使用时间选择器。我测试你的布局。由于我没有您的viewmodel,我只显示布局的gif

Xaml:


您可以从GitHub的ScorellView_TimePciker文件夹下载以供参考。

更新:

我在之前的回复中测试了相同的代码。它可以在
Xamarin.Forms 4.4.0.991265
上运行良好。您可以从GitHub上的
ScorellView\u TimePicker\u 4.4.0.991265
文件夹中查看源代码


您可以分享您的XML代码的其余部分吗?XML文件的第20行是什么?还可以在此页面共享您的C#代码。还可以共享styles.xml文件。这个错误可能有很多原因。我测试了您提供的xml代码,没有错误。你能提供更多的细节让我们复制吗?当你用timePicker点击按钮时会发生什么?我发现的原因是timePicker不能与ScrollView一起工作,这是一个bug,有一些解决方法吗?我只在android 6版本上得到这个异常。你还经历过这次坠机吗?ThanksI在GitHub上测试代码。你可以查看图像。它可以在Xamarin.Forms 4.4.0.991265上的ScorellView上使用时间选择器,没有错误。我已经更新了我的回复,你可以检查一下。我在github上没有Galaxy S5这样的设备,但是在我的设备上,它工作得很好。
<StackLayout>
    <ScrollView>
        <StackLayout>
            <Label Text="Godzina" Grid.Column="3" Grid.ColumnSpan="3"  Grid.Row="8"  TextColor="Black" Font="Bold,14"></Label>
            <TimePicker x:Name="StartHour"
            Format="T" Grid.Row="9" Grid.ColumnSpan="3"  BindingContext="{Binding StartHour}" HorizontalOptions="FillAndExpand">
            </TimePicker>
            <TimePicker x:Name="EndHour"
            Format="T" Grid.Row="9" Grid.ColumnSpan="3" BindingContext="{Binding EndHour}"  Grid.Column="3"  HorizontalOptions="FillAndExpand">
            </TimePicker>
            <Label Text="Miejsce spotkania" Grid.Row="10" Grid.ColumnSpan="6"  TextColor="Black" Font="Bold,14"></Label>
            <!--<controls:CustomEntry x:Name="Place" Grid.ColumnSpan="6" Text="{Binding Place}" Grid.Row="11"></controls:CustomEntry>-->
            <Label Text="Przypomnienie" Grid.Row="12" Grid.ColumnSpan="6"  TextColor="Black" Font="Bold,14"></Label>
            <TimePicker x:Name="Reminder"
            Format="T" Grid.Row="13" BindingContext="{Binding Reminder}" Grid.ColumnSpan="6"  HorizontalOptions="FillAndExpand">
            </TimePicker>
            <Button x:Name="MakeMeeting"  Command="{Binding CreateCommand}" Text="Stworz spotkanie" Grid.ColumnSpan="6"   BackgroundColor="#034ad7" BorderRadius="14" TextColor="FloralWhite" HeightRequest="50" VerticalOptions="Start" Grid.Row="14"></Button>
        </StackLayout>
    </ScrollView>
</StackLayout>