daniel-luberda / DLToolkit.Forms.Controls

Xamarin.Forms Custom Controls
Apache License 2.0
393 stars 182 forks source link

scrolling issue #276

Open ghost opened 5 years ago

ghost commented 5 years ago

Hello, hi have a small issue with scrolling... i have set FlowColumnCount="2" and its works fint untill its more then 2 rows, and if cant scroll down all the way.

Video, showing the issue: VIDEO

`

                <flv:FlowListView.FlowColumnTemplate>
                    <DataTemplate >
                        <StackLayout Padding="5">
                            <Frame HorizontalOptions="FillAndExpand" 
                               VerticalOptions="FillAndExpand" 
                               BackgroundColor="Black" 
                               HasShadow="False" 
                               CornerRadius="8"
                               Padding="0" 
                               Margin="0"
                               IsClippedToBounds="True">

                                <Grid>
                                    <ffimageloading:CachedImage 
                                        Source="generalOfferBg.png"
                                        Aspect="Fill"
                                        Grid.RowSpan="2"
                                        Margin="0" />
                                    <ffimageloading:CachedImage 
                                        Source="{Binding image}"
                                        WidthRequest="90"
                                        HeightRequest="90"
                                        Grid.RowSpan="2"
                                        HorizontalOptions="CenterAndExpand"
                                        VerticalOptions="StartAndExpand"
                                        Margin="0,35,0,0" />

                                    <StackLayout Grid.Row="1" Padding="20" Margin="0,25,0,0">
                                        <Label Text="{Binding descriptionRow1}" FontSize="15" TextColor="White" FontFamily="{StaticResource Quicksand-Bold}" LineBreakMode="TailTruncation" />
                                        <Label Text="{Binding descriptionRow2}"  FontSize="13" TextColor="White" FontFamily="{StaticResource Quicksand}" LineBreakMode="TailTruncation" />
                                    </StackLayout>

                                    <Grid Grid.RowSpan="2" IsVisible="{Binding showSplash}">
                                        <Frame BackgroundColor="Red" 
                                           WidthRequest="20" 
                                           HeightRequest="20" 
                                           CornerRadius="30"
                                           HorizontalOptions="End"
                                           VerticalOptions="Start" 
                                           Margin="0,25,15,0" HasShadow="False">
                                        </Frame>
                                        <Frame  
                                            BackgroundColor="Transparent"
                                            WidthRequest="60" 
                                            HeightRequest="60" 
                                            HorizontalOptions="End"
                                            VerticalOptions="Start" 
                                            Margin="0,25,15,0" HasShadow="False" Padding="0">
                                            <Label HorizontalOptions="FillAndExpand"
                                               VerticalOptions="FillAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"
                                               Text="{Binding splash}"
                                               LineHeight="0.8"
                                               FontFamily="{StaticResource Quicksand-Bold}"
                                               TextColor="White"
                                               FontSize="12"
                                               Margin="3" />
                                        </Frame>

                                    </Grid>
                                </Grid>

                            </Frame>
                        </StackLayout>

                    </DataTemplate>
                </flv:FlowListView.FlowColumnTemplate>
            </flv:FlowListView>`
KMWenyon commented 5 years ago

I have the same issue on iOS (either Visual = Default or Material not working), (Android is working), using 1 or 2 columns. Add 4 items, can only scroll items 1 - 2.2 then bounces back to top of list, cannot see 1/2 of the 3rd item and the whole 4 item. I see this item has been open for 21 days without comment.

I am using the following versions: NuGet Package version 2.0.11 Xamarin Forms 4.2.0.815419

Can you please provide update or work-around?

Below is my code:

// Create flowListView _flowListView = new FlowListView(ListViewCachingStrategy.RetainElement)
{ AutomationId = "flowListView", BackgroundColor = Color.White, FlowColumnCount = (Device.Idiom == TargetIdiom.Phone) ? 1 : 2, FlowColumnTemplate = new MyFlowListViewDataTemplateSelector(), FlowUseAbsoluteLayoutInternally = true, HasUnevenRows = false, HorizontalOptions = LayoutOptions.FillAndExpand, IsVisible = true, IsPullToRefreshEnabled = true, RowHeight = (Device.Idiom == TargetIdiom.Phone) ? 300 : 350, SeparatorVisibility = SeparatorVisibility.None, SeparatorColor = Color.Red, VerticalOptions = LayoutOptions.FillAndExpand }; _flowListView.SetBinding(FlowListView.FlowItemsSourceProperty, nameof(ViewModel.SavedFeedItemsList), BindingMode.OneWay); _flowListView.SetBinding(FlowListView.IsRefreshingProperty, nameof(ViewModel.ItemsListViewIsRefreshing), BindingMode.OneWay); _flowListView.SetBinding(FlowListView.RefreshCommandProperty, nameof(ViewModel.ListViewRefreshingAsyncCommand), BindingMode.OneWay); _flowListView.SetBinding(Label.IsVisibleProperty, nameof(ViewModel.HasSavedItems)); _contentGrid.AddChild(_bookmarkedFlowListView, 1, 0, 1, 1);

Row 1 grid length is Star and the grid Vertical options is FillAndExpand.

After the control has been created (above code) in the page constructor, the page Binding context is set.

Seems like the content length (scroll portion) is not updated when the FlowItemsSourceProperty is updated via bindings property changed, I have also tried _flowListView.ForceUpdate(true and false) in the page OnAppearing override after the BindingContext has been set with no luck.

One thing I did notice is that after pull to refresh is executed I am able to scroll to the bottom of the list.

ghost commented 5 years ago

I havent found solition yet

Skickat från min iPhone 8

24 sep. 2019 kl. 00:02 skrev Kenneth Wenyon notifications@github.com:



I have the same issue, using 1 or 2 columns. Add 4 items, can only scroll items 1 - 2.2 then bounces back to top of list, cannot see 1/2 of the 3rd item and the whole 4 item. I see this item has been open for 21 days without comment.

Can you please provide update or work-around?

Below is my code:

// Create bookmarkedFlowListView _bookmarkedFlowListView = new FlowListView(ListViewCachingStrategy.RetainElement) { AutomationId = "flowListView", BackgroundColor = Color.White, FlowColumnCount = (Device.Idiom == TargetIdiom.Phone) ? 1 : 2, FlowColumnTemplate = new MyFlowListViewDataTemplateSelector(), FlowUseAbsoluteLayoutInternally = true, HasUnevenRows = false, HorizontalOptions = LayoutOptions.FillAndExpand, IsVisible = true, IsPullToRefreshEnabled = true, RowHeight = (Device.Idiom == TargetIdiom.Phone) ? 300 : 350, SeparatorVisibility = SeparatorVisibility.None, SeparatorColor = Color.Red, VerticalOptions = LayoutOptions.FillAndExpand }; _flowListView.SetBinding(FlowListView.FlowItemsSourceProperty, nameof(ViewModel.SavedFeedItemsList), BindingMode.OneWay); _flowListView.SetBinding(FlowListView.IsRefreshingProperty, nameof(ViewModel.ItemsListViewIsRefreshing), BindingMode.OneWay); _flowListView.SetBinding(FlowListView.RefreshCommandProperty, nameof(ViewModel.ListViewRefreshingAsyncCommand), BindingMode.OneWay); _flowListView.SetBinding(Label.IsVisibleProperty, nameof(ViewModel.HasSavedItems));

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/daniel-luberda/DLToolkit.Forms.Controls/issues/276?email_source=notifications&email_token=AAD77UNED64ZWO4CNXNAL6LQLE4FRA5CNFSM4ITAEPKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7MM74Y#issuecomment-534302707, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAD77UNFJHW76BFEWIGR53TQLE4FRANCNFSM4ITAEPKA.