Click here to Skip to main content
13,629,491 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
I used ItemAppearing and ItemDisappearing events but it is not working as per my requirement(It is working fine in iOS but not in android)and i created custom render for listview for listview scroll I failed to do that. Can anyone please help me out.

What I have tried:

private void scheduleservicelist_itemappearing(object sender, xamarin.forms.itemvisibilityeventargs e)
{
var currentitem = e.item as mymodel;

if (viewmodel.mylistlist[0].id == currentitem.id)
{
headerlayout.isvisible = true;
headinggrid.margin = new thickness(0, -70, 0, 0);
}

}

private void scheduleservicelist_itemdisappearing(object sender, itemvisibilityeventargs e)
{
var currentitem = e.item as mymodel;

if (viewmodel.mylistlist[0].id == currentitem.id)
{
headerlayout.isvisible = false;
headinggrid.margin = new thickness(0, 0, 0, 0);

}
}



private void ScheduleServiceListView_Scrolled(object sender, ScrolledEventArgs e)
{


double scrollposition = e.ScrollY;
if (scrollposition > previousScrollposition)
{
isScrollUp = true;
isScrollDown = false;
}
else if(scrollposition < previousScrollposition)
{
isScrollDown = true;
isScrollUp = false;
}
else
{
if (isScrollUp)
{
isScrollUp = true;
isScrollDown = false;
} else
{
isScrollDown = true;
isScrollUp = false;
}
scrollposition = 0;
}

if (isScrollUp )
{
HeaderLayout.IsVisible = false;
HeadingGrid.Margin = new Thickness(0, 0, 0, 0);
HeadingGrid.VerticalOptions = LayoutOptions.Start;

}
else
{
HeaderLayout.IsVisible = true;
HeadingGrid.Margin = new Thickness(0, -70, 0, 0);
}
previousScrollposition = scrollposition;

}
Posted 3-Jan-18 2:15am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web03-2016 | 2.8.180712.1 | Last Updated 3 Jan 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100