refer to the above image. It is a TabbedPage with 4 tab page. May I know how can we perform this action. When user click the list, it will navigate to a new page (outside of the tabbedpage). Then, it can go back to the TabbedPage when back button clicked. Is it using ListView or navigation page? Please advise. thank you.
Asked
Active
Viewed 666 times
-4
-
I already go through the docs microsoft. It didn't help my question. – VV Voon Mar 22 '19 at 06:46
1 Answers
0
1.create a Tabbed Page and set it as mainPage of app.
in App.xaml.cs
public App()
{
InitializeComponent();
MainPage = new NavigationPage(new MyTabbedPage());
}
2.Put the contentPage in the Tabbed Page which contain the listview.
For example ,I put the listview in MainPage.
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:App8"
x:Class="App8.MyTabbedPage">
<!--Pages can be added as references or inline-->
<ContentPage Title="Tab 1" Icon="xxx.png"/> //set the title and icon of toolbar item
<local:MainPage Title="Tab 1" Icon="xxx.png"/>
<ContentPage Title="Tab 1" Icon="xxx.png"/>
</TabbedPage>
in MainPage.xaml
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:App8"
x:Class="App8.MainPage">
<ListView x:Name="listView" ItemTapped="ListView_ItemTapped" >
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell Height="30">
...
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
3.When you click the item of listview navigate to a new contentPage which contain your other listview
in MainPage.xaml.cs
private void ListView_ItemTapped(object sender, ItemTappedEventArgs e)
{
Navigation.PushAsync(new xxxContentPage(),true);
}

Lucas Zhang
- 18,630
- 3
- 12
- 22
-
Hi, but how can i display the right arrow on each cell in my list view ? – VV Voon Aug 18 '19 at 12:41