Thanks Leon, but a simple update and restart of macbook pro did the trick. I made no changes in the project and now it's working. Really weird though.
TabbedPage is not working for me
Hi,
I am following a tutorial where I create a tabbed page:
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:TravelRecordApp"
x:Class="TravelRecordApp.HomePage">
</TabbedPage>
When I try to access other pages I am only able to access my MainPage created with the project.
The other XAML contentpages I have added are not showing up for me to select.
I can only see the following:
<local:MainPage/>
The tutorial shows that you should be able to reference any other pages that are added to the project since they are under the same namespace. The local name references the project namespace so it should see the other pages. Not sure what's missing or where I am making a mistake.
Any help is appreciated!
Thank you.
1 additional answer
Sort by: Most helpful
-
Leon Lu (Shanghai Wicresoft Co,.Ltd.) 68,016 Reputation points Microsoft Vendor
2021-03-29T01:43:13.353+00:00 Hello,
Welcome to our Microsoft Q&A platform!
Firstly, please open your
App.xaml.cs
, set theMainPage
toHomePage
public App() { InitializeComponent(); MainPage = new HomePage(); }
Then, add
Title
for yourContentPage
. For example, I haveContentPage
called Page1, I add title in the XAML.<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="TabbedPageDemo.Page1" Title="Page1"> <ContentPage.Content> <StackLayout> <Label Text="Welcome to Xamarin.Forms!" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" /> </StackLayout> </ContentPage.Content> </ContentPage>
Then make sure, you add the new page in the root path of your MainPage.
Here is my demo running screenshot.
Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.