diff options
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r-- | Xamarin.Forms.Platform.Android/AppCompat/MasterDetailPageRenderer.cs | 1 | ||||
-rw-r--r-- | Xamarin.Forms.Platform.Android/Renderers/MasterDetailContainer.cs | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailPageRenderer.cs b/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailPageRenderer.cs index 18153218..50e99e50 100644 --- a/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailPageRenderer.cs +++ b/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailPageRenderer.cs @@ -122,6 +122,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat _masterLayout = new MasterDetailContainer(newElement, true, Context) { + TopPadding = ((IMasterDetailPageController)newElement).ShouldShowSplitMode ? statusBarHeight : 0, LayoutParameters = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent) { Gravity = (int)GravityFlags.Start } }; diff --git a/Xamarin.Forms.Platform.Android/Renderers/MasterDetailContainer.cs b/Xamarin.Forms.Platform.Android/Renderers/MasterDetailContainer.cs index 9184e269..7e28392f 100644 --- a/Xamarin.Forms.Platform.Android/Renderers/MasterDetailContainer.cs +++ b/Xamarin.Forms.Platform.Android/Renderers/MasterDetailContainer.cs @@ -120,6 +120,7 @@ namespace Xamarin.Forms.Platform.Android double width = Context.FromPixels(right - left); double height = Context.FromPixels(bottom - top); double xPos = 0; + bool supressPadding = false; //splitview if (MasterDetailPageController.ShouldShowSplitMode) @@ -131,11 +132,13 @@ namespace Xamarin.Forms.Platform.Android } else { + //if we are showing the normal popover master doesn't have padding + supressPadding = isMasterPage; //popover make the master smaller width = isMasterPage && (Device.Info.CurrentOrientation.IsLandscape() || Device.Idiom == TargetIdiom.Tablet) ? DefaultWidthMaster : width; } - double padding = Context.FromPixels(TopPadding); + double padding = supressPadding ? 0 : Context.FromPixels(TopPadding); return new Rectangle(xPos, padding, width, height - padding); } |