這似乎很簡單(可能是),但我似乎無法找到任何關於此的信息。c#Xamarin Forms ContentPage - 頂部差距
有全寬的白色差距之上。它是什麼?我如何擺脫它或訪問它(添加文本,按鈕,圖標等)?
對於這個測試,我的代碼非常簡單。 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"
xmlns:maps="clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps"
x:Class="TestApp.TestPage">
<StackLayout VerticalOptions="FillAndExpand" Padding="0">
<maps:Map x:Name="TestMap" IsShowingUser="true" MapType="Street" />
</StackLayout>
</ContentPage>
的.cs:
using Xamarin.Forms;
namespace Test
{
public partial class TestPage : ContentPage
{
public TestPage()
{
InitializeComponent();
}
}
}
的App.xaml:
<ResourceDictionary>
<Style TargetType="NavigationPage">
<Setter Property="BarBackgroundColor" Value="White"/>
<Setter Property="BarTextColor" Value="Black"/>
</Style>
<Style x:Key="DefaultPageStyle" TargetType="ContentPage">
<Setter Property="BackgroundColor" Value="White"/>
</Style>
</ResourceDictionary>
編輯:從@Vulcan李的評論,給我發在通向fi的路徑上找出遺漏的(關鍵)信息。
這是,裏面App.xaml.cs,我有:
public App()
{
InitializeComponent();
MainPage = new NavigationPage(new TestPage());
}
所以,這與導航菜單做。 如何訪問,格式化或刪除它?
你用什麼設備或模擬器來測試,截圖是從哪裏來的? –
@Brian Mains:此屏幕截圖來自Genymotion。但嘗試使用其中一個默認模擬器顯示基本相同的事情。 – Jahmic
我複製你的超級簡單。 xaml並在模擬器上運行,這是沒有任何空間。您可以看到以下2個仿真器屏幕截圖。 http://xamarindoggy.azurewebsites.net/Content/map1.png http://xamarindoggy.azurewebsites.net/Content/map2.png –