Android layout 如何去除窗户顶部的额外填充物?

Android layout 如何去除窗户顶部的额外填充物?,android-layout,xamarin,xamarin.android,xamarin.forms,Android Layout,Xamarin,Xamarin.android,Xamarin.forms,当我在Android上运行我的应用程序时,我有一个奇怪的填充顶部。在iOS上,它看起来和预期的一样 当我检查所有方向的填充为0时。我最后的想法是,它可能与我的一些布局有关,但我不明白这可能是什么 工具栏布局: <?xml version="1.0" encoding="UTF-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"

当我在Android上运行我的应用程序时,我有一个奇怪的填充顶部。在iOS上,它看起来和预期的一样

当我检查所有方向的填充为0时。我最后的想法是,它可能与我的一些布局有关,但我不明白这可能是什么

工具栏布局:

<?xml version="1.0" encoding="UTF-8"?>
<android.support.v7.widget.Toolbar
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:minHeight="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
    app:layout_scrollFlags="scroll|enterAlways"/>


您可以在名称空间下方的Android解决方案(MainActivity.cs)中更改许多设置

例如:

 [Activity(Theme = "@style/AppStyle.Light", Label = "ProjectName", MainLauncher = false,
    ScreenOrientation = ScreenOrientation.Portrait, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]

您可以在名称空间下方的Android解决方案(MainActivity.cs)中更改许多设置

例如:

 [Activity(Theme = "@style/AppStyle.Light", Label = "ProjectName", MainLauncher = false,
    ScreenOrientation = ScreenOrientation.Portrait, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]

这是操作栏的空间。尝试在styles.xml中向主题添加false。@HeisenBerg false false 0dp无效,仍然错误。。。我使用这个perent“Theme.AppCompat.Light.NoActionBar”,并没有任何改变,而是将true添加到您的样式中。尝试在styles.xml中向主题添加false。@HeisenBerg false false 0dp无效,仍然错误。。。我使用这个perent“Theme.AppCompat.Light.NoActionBar”,并没有任何更改,只是在styles.xml中添加了true