How to scroll a ListView to the bottom of the page? - xamarin

I have a XAML page in Xamarin Forms. I create a Grid in code behind dynamically,after loading my data. After creating the Grid I need my ScrollView to scroll to the bottom of the page, how? How can I load my grid without scrolling of it ...?
I use
scroll.ScrollToAsync(lastLabel, ScrollToPosition.End, true)
but I do not get any result.

Related

Xamarin Forms: Hide a Stack While Scrolling a list

I have a Xamarin forms Page which is divided into 2 sections, the top 40% contains the Search controls inside a stack layout, the other 60% contains a list view. While scrolling the list view up I want to hide the Stack Layout at the top covering 40% of the screen.
I achieved to implement scroll events of the list from below reference:
https://github.com/velocitysystems/xf-controls/blob/master/XF.Controls/XF.Controls/Views/ListView.cs
I am able to hide the stackLayout but there is a lot of flickering. Any idea how can I stop the flickering? the output is not crisp and stable.
You can use animation TranslateTo for StackLayout.
Example:
OnScrolled()
{
Device.BeginInvokeOnMainThread(() => {
if (isScrollToUp)
HeaderStackLayout.TranslateTo(0,-500);
else
HeaderStackLayout.TranslateTo(0,500);
});
}
You could put the search controls as the header of the ListView:
https://developer.xamarin.com/guides/xamarin-forms/user-interface/listview/customizing-list-appearance/#Headers_and_Footers
As the header is a part of the ListView itself it will scroll as expected once you have enough content to scroll through.

multiple ScrollView not working on xamarin forms

Multiple ScrollView is not working on my content page Xamarin forms.so how to solve this?
i added two scrollviiew in my content page,but the second one is not scrolling.
Do not put a ListView inside a ScrollView.
Avoid placing a ListView inside a ScrollView for the following reasons:
The ListView implements its own scrolling.
The ListView will not receive any gestures, as they will be handled
by the parent ScrollView.
The ListView can present a customized header and footer that scrolls
with the elements of the list, potentially offering the functionality
that the ScrollView was used for. For more information see Headers
and Footers.
If you need more ListView on some Page you should use one ListView with Group.

List view height setting along with scroll #Xamarin Forms

I have integrated a list view which fetches data from using a web-service along with other layouts in a content page.
by giving HasUnevenRows="True" property the list view appeared with a 1 row size with scrolling inside so that i was able scroll and view all data inside.
I want to increase the height without losing the scroll.I tried height request to list view and the stacklayout but the scroll is not working.How can i get this done?
thanks in advance
please click to view Xaml code
click to view the screenshot

Xamarin Forms label animation at bottom of screen

I'm essentially making a 'shopping cart' UI and I want it so that when the user hits the 'Add' button, a little tiny box-label appears at the bottom of the screen that says 'Added Item' or something like that.
My question is how to do that with my current set up. I am currently using a nested Grid inside of a Scroll view for the main content of the page. I want the box-label to fade in at the bottom of the screen and stay located at the bottom of the screen ontop of everything else even if you scroll, until the animation fades.
Now i figure it doesn't make sense to add it into the grid since the grid's end will be out of view in the scrolling part of the scroll view, and same for the Scroll View. I am considering nesting the entire scroll view inside of a stack layout but i fear the button will just be located at the end of the stack layout under the scroll view instead of on TOP of the scroll view. How do you recommend I achieve this effect?
I prefer not to use a custom renderer if possible due to my lack of experience in the three separate platforms.
Thanks
Make vertically oriented stack layout. When you need to add you animation add it programmatically to the stack. When it finishes remove it from stack. Your scroll view will not affect animation

MWPhotoBrowser display caption in grid view

I know MWPhotoBrowser supports captions on MWPhoto. However the captions are not displayed while the grid is being displayed. Is there a setting to display captions in grid view?
MWPhotoBrowser doesn't display captions in the grid view. This behaviour can't be found in the documentation or the GitHub page of it

Resources