Forum Xamarin.Forms

Views getting bigger or smaller than requested size in listview

aga913aga913 Member ✭✭✭

Hi,
as the title says i have a listview and in its viewcell i have a couple frames and an image button
1. the image in the image button sometimes gets to a smaller size than expected and gets to the top left corner however the buttons size is left unharmed
2. one of the frames width gets bigger than expected the frames text is the same in all views so there is no chance that there is a different in their sizes but there somehow is
3. these size bugs appear and disappear while scrolling up and down some example: if there was a size bug in a listview item i scroll down and then go up again so the bug is not there anymore but the same goes the other way around so if there is a healthy listview item by scrolling up and down it may change its size to the unexpected size :/
and the thing is the size of the bugged items is the same across them all they all have the same smaller/bigger size...

hope my explanation is understandable

Answers

  • jezhjezh Member, Xamarin Team Xamurai

    According to your description, I could't reproduce this question on my side.

    Could you please post some code snippet about your list and it's viewcell so that we can test on our side?

    Meanwhile ,please also upload your test icon.

    Best regards!

  • aga913aga913 Member ✭✭✭
    edited June 9

    Maybe the problem is that i have a lot of views that it does not render all of them correctly ?
    However i have found some sort of work around for the image witch is to set the Aspect="Fill" but still the other 2 properties still produce the property as expected :/
    i'm sorry i don't understand, what do you mean by upload your test icon ?


    <ListView.ItemTemplate>



    <Grid.RowDefinitions>




    </Grid.RowDefinitions>






                                    <StackLayout    Grid.Row="1" x:Name="stkCat"  Orientation="Horizontal" BindableLayout.ItemsSource="{Binding category}" FlowDirection="RightToLeft">
                                        <BindableLayout.ItemTemplate>
                                            <DataTemplate>
                        <!--This is the Frame that also have the visual bug-->
                                                <Frame CornerRadius="0" HorizontalOptions="Center" VerticalOptions="Center" BackgroundColor="{Binding .,Converter={StaticResource  CatId2ClrCnvrt}}" Padding="10,4">
                                                    <Frame.GestureRecognizers>
                                                        <TapGestureRecognizer Tapped="BtnCat_Clicked"/>
                                                    </Frame.GestureRecognizers>
                                                    <Label FontFamily="{StaticResource BoldFont}"  Text="{Binding .,Converter={StaticResource CatId2NameCnvrt}}" FontSize="11" TextColor="#fff"/>
                                                </Frame>
    
                                            </DataTemplate>
                                        </BindableLayout.ItemTemplate>
                                    </StackLayout>
                                    <Label          Grid.Row="2" LineHeight="0.8" Text="{Binding title}" VerticalTextAlignment="Start" FlowDirection="RightToLeft"  TextColor="Black" FontFamily="{StaticResource BoldFont}" FontSize="14"/>
                                    <StackLayout    Grid.Row="3" Orientation="Horizontal" FlowDirection="RightToLeft" VerticalOptions="End">
                                        <Label Text="{Binding pubDateStr}" FontFamily="{StaticResource RegularFont}" HorizontalOptions="FillAndExpand" TextColor="#383838" FontSize="11"/>
                                       <!-- <ImageButton Clicked="Btn3Dots_Clicked" Padding="0,5,50,5" x:Name="btn3Dots" BackgroundColor="Green" HeightRequest="13" WidthRequest="19" BorderWidth="0" Aspect="AspectFill" Source="dotsVertical"/>-->
                                        <Frame Padding="10" BackgroundColor="Transparent">
                                            <Frame.GestureRecognizers>
                                                <TapGestureRecognizer Tapped="Btn3Dots_Clicked"/>
                                            </Frame.GestureRecognizers>
    
                                            <Image  x:Name="btn3Dots" BackgroundColor="Transparent" HeightRequest="13" WidthRequest="19" Aspect="AspectFill" Source="dotsVertical" InputTransparent="True"/>
                                        </Frame>
                                    </StackLayout>
                                </StackLayout>
                            </Grid>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
    

    this is my Listview i still have other code in the same page but i think its irrelevant to the problem, still i can provide more code if needed..

  • jezhjezh Member, Xamarin Team Xamurai

    Hi, aga913, your post code is not fully displayed.

    i'm sorry i don't understand, what do you mean by upload your test icon ?

    I mean could you share the player icon here,we can test with it.

Sign In or Register to comment.