0
votes

Hi I have just started using xamarin to try and develop a cross platform application but I have hit a problem very early on with my winphone project.

I have a tabbedpage which contains 2 navigationpages. Both these navigationpages have identical content the only thing that differs is the Title of each. The problem comes when swiping between the tabbed pages. When first loaded it renders correctly but once I have gone around the tabbed once I seem to lose a Title and the other 1 jumps to the top of the page which I don't want. The location tabbedpage renders fine.

When app is opened

After viewing the Location tab

MainPage.xaml

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:local="clr-namespace:iLarm;assembly=iLarm"
         x:Class="iLarm.MainPage">
<NavigationPage Title="Alarm">
    <x:Arguments>
      <local:AlarmListPage />
    </x:Arguments>
  </NavigationPage>
  <NavigationPage Title="Location" >
    <x:Arguments>
      <local:LocationListPage />
    </x:Arguments>
  </NavigationPage>
</TabbedPage>

AlarmListPage.xaml

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         x:Class="iLarm.AlarmListPage"
         Title="iLarm">
</ContentPage>

locationListPage.xaml

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         x:Class="iLarm.LocationListPage"
         Title="iLarm">
</ContentPage>
1
Could you please post some codes or share a basic demo that can reproduce this problem ? And could you please try it on a blank empty app to see if this problem persists ?Nico Zhu - MSFT
Hi Nico xaml code added and currently no code behind. This is basically an empty app I have just added the tabbedPage, NavigationPages and content pages since creating the blank Xamarin.forms app through visual studio.Charlie

1 Answers

0
votes

According to your codes, I wrote a demo. But the title of ContentPage didn't show at all.

From your screenshot I suppose you want to add title to top of the TabbedPage. According to this requirement you just need to set Title of TabbedPage likes below.

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:local="clr-namespace:iLarm;assembly=iLarm"
         x:Class="iLarm.MainPage"
         Title="iLarm">
   <NavigationPage Title="Alarm">
       <x:Arguments>
           <local:AlarmListPage />
       </x:Arguments>
   </NavigationPage>

   <NavigationPage Title="Location">
       <x:Arguments>
           <local:LocationListPage />
       </x:Arguments>
   </NavigationPage>
</TabbedPage>