Issue
I have:
MainView.xaml
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" BackgroundColor="#fff" ... > <views:Page1 Title="Page1" IconImageSource="homeicon" BackgroundColor="#fff"/> <views:Page2 Title="Page2" IconImageSource="order" BackgroundColor="#fff"/> <views:Page3 Title="Page3" IconImageSource="ads" BackgroundColor="#fff"/> <views:Page4 Title="Page4" IconImageSource="usericon" BackgroundColor="#fff"/> </TabbedPage>
and i have 1 login page. After logging in, you will be redirected to Page4.
I use: App.Current.MainPage = new NavigationPage(new Page4())
if (response.IsSuccessStatusCode)
{
var responseBody = await response.Content.ReadAsStringAsync();
App.Current.MainPage = new Page4();
}
However I don't show TabbedPage
How to show the list of Tabs below. Please help me with the solution. Thank you
Update I try
On Log in => App.Current.MainPage = new MainView();
Log Out => App.Current.MainPage = new LoginPage();
It still doesn't work
Solution
Put your page inside a navigation page. That should help you fix it.
Update:
In MainView.xaml.cs put this
public MainView(int index)
{
InitializeComponent();
SetPage(index);
}
void SetPage(int index) { CurrentPage=Children[index]; }
after login, do this
App.Current.MainPage = new NavigationPage(new MainView(3))
Answered By - Ninaada Bellippady


0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.