Hello.

I have 2 listviews. I'm trying to scroll one of them programmatically, but
it isn't work correctly, not always.

Code:

private void ScrollList(byte listId, byte direction){
    var lv = listId == LISTVIEW1 ? _ListView1 : _ListView2;
    int pos = 0;
    if(direction==1)
    {
        pos = lv.FirstVisiblePosition - 2;
        pos = pos < 0 ? 0 : pos;
    }
    else
    {
         pos = lv.LastVisiblePosition + 1;
         pos = pos > lv.Count? lv.Count:pos;
    }
    
    lv.SmoothScrollToPosition(pos);
}



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Programmatically-scroll-of-list-view-tp5711719.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to