Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Listview current position should remain the same when switching tabs in a TabbedPage

$
0
0

If I scroll the ListView to a position and switch to another tab, then switch back, the position resumes to the first item.

Expected: the position is not changed.
I use Xamarin.Forms 1.2.3.

Old 1.0 version is ok.

`

public class App
{
    public static Page GetMainPage()
    {   
        var s = new string[100];
        for (int i = 0; i < s.Length; i++)
            s[i] = i.ToString();

        var lst = new ListView();
        lst.ItemsSource = s;
        lst.ItemTemplate = new DataTemplate(typeof(TextCell));
        lst.ItemTemplate.SetBinding(TextCell.TextProperty, ".");

        return new TabbedPage
        {
            Children =
            {   new ContentPage{ Title = "Tab1", Content = lst },
                new ContentPage{ Title = "Tab2", Content = new Label{ Text = "Tab2..." } }
            }
        };
    }
}

`


Viewing all articles
Browse latest Browse all 58056

Trending Articles