I am new to Xamarin and I have a question as to how to add Listview to a Tab?
tab1 = new UIViewController ();
tab1.TabBarItem = new UITabBarItem ();
tab1.TabBarItem.Image = UIImage.FromFile ("home.png");
tab1.Title = "Home";
// how to I add List View to this tab?
// Sample ListView
public class TestList : ContentPage
{
public TestList ()
{
var listView = new ListView
{
RowHeight = 40
};
listView.ItemsSource = new string []
{
"Buy pears",
"Buy oranges",
"Buy mangos",
"Buy apples",
"Buy bananas"
};
Content = new StackLayout
{
VerticalOptions = LayoutOptions.FillAndExpand,
Children = { listView }
};
}
}
Any examples would greatly help.