Search button of my project not appearing

Asked

Viewed 34 times

1

I have in one of my screens a peculiar problem, is not appearing the search search on one of the smartphones, but in others and in Genymotion appear.

inserir a descrição da imagem aqui

Note: Apparatus 1 = Galaxy Note 5, apparatus 2 = Quantum MUV

Follows the code:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="FoodSuppy.Tela.LeilaoAberto"
             Title="Leilão Aberto">
    <ContentPage.Content>
        <AbsoluteLayout>
            <StackLayout AbsoluteLayout.LayoutBounds="0, 0, 1, 1" 
                         AbsoluteLayout.LayoutFlags="All">

                <!-- Pesquisa -->
                <SearchBar x:Name="MainSearchBar"
                           Placeholder="Digite o nome do produto..." 
                           Margin="10, 10, 10, 0"
                           FontSize="Small"
                           BackgroundColor="Aquamarine"
                           TextChanged="OnTextChanged"/>

                <!-- Listagem de Produtos -->
                <ListView x:Name="lstLeilao" 
                          ItemTapped="OnTapLance"
                          HasUnevenRows="True"
                          SeparatorColor="DodgerBlue"
                          BackgroundColor="Aqua"
                          Margin="10, 5, 10, 10">

                    <ListView.ItemTemplate>
                        <!-- DataTemplate  = exibe dados de uma coleção de objetos em um ListView -->
                        <DataTemplate>
                            <ViewCell>
                                <Grid Margin="2">

                                    <!-- Colunas -->
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>

                                    <!-- Linhas -->
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>

                                    <!-- Código do Leilão -->
                                    <Label Grid.Row="0"
                                           Grid.Column="0"
                                           Text="Cód Leilão: "
                                           FontSize="Small"/>
                                    <Label Grid.Row="0" 
                                           Grid.Column="1"
                                           Text="{Binding ID_LEILAO}"
                                           FontSize="Small"/>

                                    <!-- Código do Leilão -->
                                    <Button Grid.Row="0"
                                            Grid.Column="2" 
                                            BackgroundColor="{Binding COR}"
                                            HorizontalOptions="End"
                                            HeightRequest="10"
                                            WidthRequest="20"
                                            BorderRadius="10"/>

                                    <!-- "Data do Término -->
                                    <Label Grid.Row="1" 
                                           Grid.Column="0"
                                           Text="Data do Término: "
                                           FontSize="Small"/>
                                    <Label Grid.Row="1" 
                                           Grid.Column="1"
                                           Grid.ColumnSpan="2"
                                           Text="{Binding DT_TERMINO}"
                                           FontSize="Small"/>

                                    <!-- Produtos -->
                                    <Label Grid.Row="2" 
                                           Grid.Column="0"
                                           Text="Produto: "
                                           FontSize="Small"/>
                                    <Label Grid.Row="2" 
                                           Grid.Column="1"
                                           Grid.ColumnSpan="2"
                                           Text="{Binding PRODUTO}" 
                                           TextColor="Black"
                                           FontAttributes="Bold"
                                           FontSize="Small"/>

                                    <!-- Quantidade -->
                                    <Label Grid.Row="3" 
                                           Grid.Column="0"
                                           Text="Quantidade: "
                                           FontSize="Small"/>
                                    <Label Grid.Row="3" 
                                           Grid.Column="1"
                                           Text="{Binding QTDE}" 
                                           TextColor="Black"
                                           FontSize="Small"/>

                                </Grid>

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

            <!-- Loading -->
            <StackLayout IsVisible="{Binding IsLoading}" 
                         AbsoluteLayout.LayoutBounds="0, 0, 1, 1"
                         AbsoluteLayout.LayoutFlags="All"  
                         BackgroundColor="DodgerBlue" 
                         Opacity="0.5">

                <!-- Loading -->
                <ActivityIndicator x:Name="actInd"
                                   IsRunning="{Binding IsLoading}"
                                   IsVisible="{Binding IsLoading}"
                                   Color="DarkBlue"
                                   HeightRequest="60"
                                   WidthRequest="60"
                                   BackgroundColor="Transparent"
                                   HorizontalOptions="CenterAndExpand"
                                   VerticalOptions="CenterAndExpand">
                </ActivityIndicator>
            </StackLayout>

        </AbsoluteLayout>
    </ContentPage.Content>
</ContentPage>

1 answer

0


I fixed size on the grid and now appears normally.

inserir a descrição da imagem aqui

                    <!-- Pesquisa -->
                    <SearchBar Grid.Column="0"
                               Grid.Row="0"
                               x:Name="MainSearchBar"
                               Placeholder="Digite o nome do produto..." 
                               Margin="5, 5, 5, 0"
                               FontSize="Small"
                               BackgroundColor="Aquamarine"
                               TextChanged="OnTextChanged"
                               HeightRequest="35"/>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.