1

Tenho em uma de minhas telas um problema peculiar, não está aparecendo o Search de pesquisa num dos smartphones, mas em outros e no Genymotion aparecem.

inserir a descrição da imagem aqui

Obs: Aparelho 1 = Galaxy Note 5, aparelho 2 = Quantum MUV

Segue o código:

<?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 Resposta 1

0

Fixei tamanho no grid e agora aparece normalmente.

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"/>

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .