网格与iOS中的ListView重叠-XamarinForms

时间:2018-10-22 16:10:18

标签: xamarin.forms

我有一个网格,其中有一个选择器来过滤ListView中Items的状态。应用首次加载时,布局看起来还不错,但是如果我不等待第二秒钟再单击完成按钮,则可以过滤状态Grid Overlaps Listview。它仅适用于iOS。 正常页面加载:

enter image description here

过滤后:

enter image description here

<Grid RowSpacing="0" ColumnSpacing="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>                    
                </Grid.RowDefinitions>
                <StackLayout Orientation="Horizontal" Padding="10" Grid.Row="0" IsVisible="{Binding showSearchBar, Converter={converters:InvertedBooleanConverter}}">                       
                    <Label Text="Status" Style="{DynamicResource FontLabel}" FontSize="Medium" VerticalTextAlignment="Center" />
                    <Picker Title="Status" WidthRequest="155" TextColor="Black" SelectedItem="{Binding StatusFilter, Mode=TwoWay}">
                        <Picker.ItemsSource>
                            <x:Array Type="{x:Type x:String}">
                                <x:String>All</x:String>                                    
                                <x:String>Problem</x:String>                                   
                            </x:Array>
                        </Picker.ItemsSource>
                    </Picker>
                    <iconize:IconButton Text="fa-search" FontSize="Medium" TextColor="#666666" HorizontalOptions="EndAndExpand" VerticalOptions="Center"  WidthRequest="50" Command="{Binding SearchBarOnOff}"/>
                </StackLayout>

                <StackLayout Orientation="Horizontal" Padding="0,10,0,10" Grid.Row="1" IsVisible="{Binding showSearchBar}">                      

                    <Entry x:Name="Search" Text="{Binding FilterText}" WidthRequest="150" HeightRequest="50" Placeholder="Search" PlaceholderColor="#555555" HorizontalOptions="StartAndExpand" VerticalOptions="CenterAndExpand"/>
                    <Label Text="Find" Style="{DynamicResource FontLabel}" VerticalOptions="Center" HorizontalOptions="EndAndExpand" Margin="5" TextColor="#0b8442">
                        <Label.GestureRecognizers>
                            <TapGestureRecognizer Command="{Binding SearchItems}"/>
                        </Label.GestureRecognizers>
                    </Label>
                    <Label Text="Cancel" Style="{DynamicResource FontLabel}" VerticalOptions="Center" HorizontalOptions="EndAndExpand" Margin="5">
                        <Label.GestureRecognizers>
                            <TapGestureRecognizer Command="{Binding SearchBarOnOff}"/>
                        </Label.GestureRecognizers>
                    </Label>
                </StackLayout>
            </Grid>

                <ListView ItemsSource="{Binding Items}" VerticalOptions="FillAndExpand" HasUnevenRows="True" IsPullToRefreshEnabled="True" IsRefreshing="{Binding IsBusy}" RefreshCommand="{Binding GetItemsCommand}" CachingStrategy="RecycleElement">

                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <ViewCell>                                    
                                <StackLayout>
                                    // some code ..............
                                </StackLayout>
                            </ViewCell>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>

有什么办法可以解决?

0 个答案:

没有答案
相关问题