locked
Custom List View Image Size Shifting RRS feed

  • Question

  • User387044 posted

    So I have a Custom List View, it keeps shifting image size when I scroll through the image. I have tried using svg files as one blog suggested but that doesn't change the issue at all, here is the code.

    <ListView RowHeight="130" x:Name="NewsList" ItemsSource="{Binding CleanList}">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <ViewCell>
                                <StackLayout Orientation="Horizontal">
                                <Frame WidthRequest="230" HeightRequest="100" BackgroundColor="#1a6de0" CornerRadius="10">
                                    <Label Text="{Binding Newsitem}" FontAttributes="Bold" TextColor="White" LineBreakMode="WordWrap" MaxLines="5" />
                                </Frame>
                                    <Frame WidthRequest="60" HeightRequest="100" BackgroundColor="#1a6de0" CornerRadius="10">
                                        <ImageButton BackgroundColor="#004c99"  Command="{Binding BindingContext.DeleteCommand, Source={x:Reference NewsList}}" CommandParameter="{Binding .}"
                                                             Source="delete.svg" HeightRequest="60" WidthRequest="60" VerticalOptions="CenterAndExpand" HorizontalOptions="EndAndExpand" />
                                    </Frame>
                                </StackLayout>
                                <ViewCell.ContextActions>
                                    <MenuItem Text="GoTo"  Command="{Binding NewsViewCommand}"/>
                                </ViewCell.ContextActions>
                            </ViewCell>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
    
    Saturday, September 21, 2019 10:37 AM

Answers

  • User369978 posted

    Try to use replace ImageButton with Image , and add tap gesture on the image .

    Check if the problem persists.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, September 23, 2019 9:20 AM

All replies

  • User369978 posted

    Try to use replace ImageButton with Image , and add tap gesture on the image .

    Check if the problem persists.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, September 23, 2019 9:20 AM
  • User387044 posted

    Will do and when I'm done I'll update this thread, I updated my project and didn't backup before, so now I have to work through a very old version.

    Monday, September 23, 2019 9:26 AM
  • User369978 posted

    Any updates ?

    Friday, September 27, 2019 7:06 AM
  • User387044 posted

    It works, but why would you have to have a work around for something so simple, it doesn't make sense.

    Friday, September 27, 2019 7:38 AM