Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

What is causing my application to have this unused space at the bottom of the screen?

$
0
0

EDIT: Oops, meant to designate this as a question, not a discussion.. Don't seem to be able to change it after the fact though :(

In my PCL project, I am using a TabbedPage to display the app's content. When I load the app on iOS, for some reason it ends up having a lot of unused screen space beneath the tabs themselves. This does not occur on Android and seems to be fixed if the user rotates the phone (and hence, the app) and then returns it to its original orientation. I've included the below screenshots to show what I mean:

The main view code being called to display this (and which I think is at the heart of the problem) is as follows:

<?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:viewModels="clr-namespace:CtsMobile.ManualViewer.ViewModels;assembly=CtsMobile.ManualViewer"
             xmlns:views="clr-namespace:CtsMobile.ManualViewer.Views;assembly=CtsMobile.ManualViewer"
             x:Class="CtsMobile.ManualViewer.Views.TabbedMainView">
  <TabbedPage.BindingContext>
    <viewModels:MainViewModel />
  </TabbedPage.BindingContext>
  <TabbedPage.Children>
    <ContentPage Title="Online">
      <views:OnlineView BindingContext="{Binding OnlineViewModel}" />
    </ContentPage>
    <ContentPage Title="Local">
      <views:LocalView BindingContext="{Binding LocalViewModel}" />
    </ContentPage>

  </TabbedPage.Children>
</TabbedPage>

The code-behind for the above XAML is as follows:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;

namespace CtsMobile.ManualViewer.Views
{
    public partial class TabbedMainView : TabbedPage
    {
        public TabbedMainView()
        {
            InitializeComponent();
            if (Device.OS == TargetPlatform.iOS)
            {
                this.Padding = new Thickness(3);
                foreach (var child in this.Children)
                    child.Padding = new Thickness(0, 17, 0, 0);
            }
        }

        protected override void OnAppearing()
        {
            base.OnAppearing();
            NavigationPage.SetHasNavigationBar(this, false);
        }
    }
}

If need be I can also share the views being called by the TabbedPage above, but I do not think that they are relevant to the issue. The issue persists despite switching between the two tabs and only seems to be resolved when device rotation occurs. Any ideas on what may be going wrong?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>