TableView里面的Xamarin WebView失去了价值

时间:2018-01-05 14:49:02

标签: c# listview xamarin webview tableview

我的WebView填充了来自数据库的HTML代码。

WebView位于TableView

这是XAML代码:

        <TableView Intent="Form" HasUnevenRows="True" Margin="0,0,0,0">
            <TableRoot>

                <!--#region Nota-->
                <TableSection Title="{core:Translate LblNota}">
                    <ViewCell>
                        <ViewCell.View>
                            <StackLayout>
                                <Label BackgroundColor="Purple" Text="{Binding NotaRigaHtml}" Style="{StaticResource LblDescrizione}" />
                                <WebView IsEnabled="False" HeightRequest="200" Source="{Binding NotaRigaHtml}"/>
                            </StackLayout>

                        </ViewCell.View>
                    </ViewCell>
                </TableSection>
                <!--#endregion-->

                <!--#region Lista Tecnici -->
                <TableSection Title="{core:Translate Tecnici}">
                    <ViewCell>
                        <ViewCell.View>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>

                                <ListView Grid.Row="0" Grid.Column="0" x:Name="ListaTecniciIntervento" HasUnevenRows="True" SeparatorVisibility="None" ItemsSource="{Binding ListaTecnici}" HeightRequest="{Binding AltezzaListaTecnici}">
                                    <ListView.ItemTemplate>
                                        <DataTemplate>
                                            <view:TecniciInterventoViewCell Pagina="{x:Reference RigaDettaglioPage}" />
                                        </DataTemplate>
                                    </ListView.ItemTemplate>
                                </ListView>
                            </Grid>
                        </ViewCell.View>
                    </ViewCell>
                </TableSection>
                <!--#endregion-->

                <!--#region Passaggio successivo-->
                <TableSection Title="{core:Translate LblPassaggioSuccessivo}">
                    <ViewCell>
                        <ViewCell.View>
                            <Grid Style="{StaticResource GridPadding}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <Label Text="{core:Translate LblProgressStatus}"  Grid.Row="0" Grid.Column="0" />
                                <Picker Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3"/>
                                <Label Text="{core:Translate LblProgressStatusLevel}"  Grid.Row="1" Grid.Column="0" />
                                <Picker Grid.Row="1" Grid.Column="1" />
                                <Label Text="{core:Translate utente}"  Grid.Row="1" Grid.Column="2" />
                                <Picker Grid.Row="1" Grid.Column="3" />
                                <Label Text="{core:Translate LblProgressStatusInstallatore}"  Grid.Row="2" Grid.Column="0" />
                                <Picker Grid.Row="2" Grid.Column="1" />
                                <Label Text="{core:Translate LblProgressStatusTecnico}"  Grid.Row="2" Grid.Column="2" />
                                <Picker Grid.Row="2" Grid.Column="3" />
                            </Grid>
                        </ViewCell.View>
                    </ViewCell>
                </TableSection>
                <!--#endregion-->

            </TableRoot>
        </TableView>

WebView离开屏幕时,数值会消失。

我该如何避免这种行为?

为什么清除WebView

谢谢!

enter image description here

修改 我发现问题是ListView

ListView的项目在屏幕之外时,会触发此问题,但我无法解决:(

0 个答案:

没有答案