Tabbed page has odd space at top and empty bar (screenshot)

iooovoltsiooovolts Member ✭✭
edited June 15 in Xamarin.Forms

I am using MvvmCross.Forms and I have noticed that any time I create an MvxTabbedPage it comes along with the space shown in the screenshot. Has anyone else had this experience? I would love to know why to prevent it happening in the future and help others (Xamarin Forms newbie here). Thanks in advance!!

XAML

<views:MvxTabbedPage 
             x:TypeArguments="viewModels:HomeViewModel"         
             xmlns:mvx="clr-namespace:MvvmCross.Forms.Bindings;assembly=MvvmCross.Forms"
             xmlns:views="clr-namespace:MvvmCross.Forms.Views;assembly=MvvmCross.Forms" 
             xmlns:viewModels="clr-namespace:CookIn.Core.ViewModels;assembly=CookIn.Core"    
             xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:local="clr-namespace:Test.UI.Views"
             mc:Ignorable="d"
             BarBackgroundColor="#2196F3"
             BarTextColor="White"
             x:Class="Test.UI.Views.HomeView">
  <!--Pages can be added as references or inline-->
    <local:KitchenView Title="Kitchen"/>
    <local:ExploreView Title="Test1"/>
    <local:CookInView Title="Test2"/>
    <local:ProfileView Title="Test3"/>
</views:MvxTabbedPage>

Code Behind

    public partial class HomeView : MvxTabbedPage<HomeViewModel>
    {
        public HomeView()
        {
            On<Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);
            InitializeComponent();
        }
    }

Screenshot

Best Answer

  • iooovoltsiooovolts ✭✭
    Accepted Answer

    If anyone comes across this problem simply put this attribute above your View which inherits MvxTabbedPage<>
    [MvxTabbedPagePresentation(TabbedPosition.Root, NoHistory = false)]

Answers

  • iooovoltsiooovolts Member ✭✭
    Accepted Answer

    If anyone comes across this problem simply put this attribute above your View which inherits MvxTabbedPage<>
    [MvxTabbedPagePresentation(TabbedPosition.Root, NoHistory = false)]

Sign In or Register to comment.