Scrollview does not roll on 320x240 screen

Asked

Viewed 180 times

1

I have a shaman page with a Scrollview and a Listview that work normally on popular smartphones. The problem is that the scroll bar does not work on the Samsung Pocket Duos device, which has a screen of 320x240 and 2.8". As many people still use this device, limiting the app to it is not an option. Any idea?

<ContentPage.Content>
    <StackLayout Orientation="Vertical" ><!--VerticalOptions="FillAndExpand"-->

        <StackLayout Padding="12,8,8,0" Orientation="Horizontal" Spacing="0">
            <Label x:Name="txtPrefixoTitulo" Text="Vagas para" FontSize="12" TextColor="#000000" Opacity="0.54" VerticalTextAlignment="Center" LineBreakMode="WordWrap"  Margin="0"/>
            <Label x:Name="txtFuncaoCidade" Text="" FontSize="12" FontAttributes="Bold" TextColor="#000000" Opacity="0.54" VerticalTextAlignment="Center" LineBreakMode="WordWrap" Margin="0" />
        </StackLayout>

        <Label Font="Bold,20" x:Name="labelLoader" TextColor="#4a90e2" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" IsVisible="False" Text="Carregando vagas, por favor aguarde." />
        <ActivityIndicator Color="#4a90e2" IsRunning="false" x:Name="loader" IsVisible="false"/>

        <ScrollView Padding="8, 0, 8, 0" VerticalOptions="FillAndExpand" x:Name="scroll">
            <ListView x:Name="lstView"  HasUnevenRows="true" VerticalOptions="Fill" BackgroundColor="#f4f4f4" SeparatorVisibility="None" ItemAppearing="ItemAppearing">
                <ListView.ItemTemplate><!--SelectedItem="teste"-->
                    <DataTemplate>
                        <ViewCell AutomationId="viewCellVaga">
                            <StackLayout Orientation="Vertical" BackgroundColor="{Binding CorFundo}" Padding="16, 12, 16, 20" VerticalOptions="Fill"  Spacing="0" Margin="0, 4">
                                <StackLayout Orientation="Horizontal" HorizontalOptions="Fill">
                                    <Image Source="{Binding SourceImagemListVagas}" IsVisible="{Binding MostraImagem}" HeightRequest="20" WidthRequest="96" HorizontalOptions="StartAndExpand"/>
                                    <Image Source="{Binding SourceCheckVagaCandidatada}" IsVisible="{Binding MostraCheckCandidatada}" HeightRequest="20" WidthRequest="20" HorizontalOptions="End"/>
                                </StackLayout>
                                <Label Text="{Binding Funcao}" FontSize="24" FontAttributes="Bold" TextColor="#000000" Opacity="0.87" Margin="0"/>
                                <StackLayout Orientation="Horizontal" Margin="0,4,0,0" IsVisible="{Binding MostraEmpresa}">
                                    <Label Text="Empresa:" FontAttributes="Bold"  FontSize="14" TextColor="#000000" Opacity="0.54"/>
                                    <Label Text="{Binding EmpresaResumida}" FontSize="14" TextColor="#000000" Opacity="0.54"/>
                                </StackLayout>
                                <StackLayout Orientation="Horizontal" Margin="0,4,0,0">
                                    <Label Text="Salário:" FontAttributes="Bold"  FontSize="14" TextColor="#000000" Opacity="0.54"/>
                                    <Label Text="{Binding Salario}" FontSize="14" TextColor="#000000" Opacity="0.54"/>
                                </StackLayout>
                                <StackLayout Orientation="Horizontal" Margin="0,0,0,4">
                                    <Label Text="Localização:" FontAttributes="Bold"  FontSize="14" TextColor="#000000" Opacity="0.54"/>
                                    <Label Text="{Binding CidadeEstado}" FontSize="14" TextColor="#000000" Opacity="0.54"/>
                                </StackLayout>
                                <Label Text="{Binding DescricaoResumida}" FontSize="14" TextColor="#000000" Opacity="0.54" Margin="0" />
                            </StackLayout>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </ScrollView>
    </StackLayout>

</ContentPage.Content>
  • Do not edit the question to put the solution. If so, post an answer.

2 answers

1


Fixed: I took out Scrollview and used only the integrated scroll of Listview. I put VerticalOptions="FillAndExpand" in Listview. It worked in all resolutions.

0

Your Scrollview is inside Stacklayout, so it may be that, as this device has low resolution, the first items take up all available space, thus not appearing Scrollview...

I’d put Scrollview and the others inside it.

Browser other questions tagged

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