/// <summary> /// Layouts the children. /// </summary> /// <param name="x">The x coordinate.</param> /// <param name="y">The y coordinate.</param> /// <param name="width">Width.</param> /// <param name="height">Height.</param> protected override void LayoutChildren(double x, double y, double width, double height) { if (_startingHeight < 0) { _startingHeight = StatusBarService.Height; } var newStatusBarPadding = StatusBarPadding; if (Math.Abs(newStatusBarPadding - _oldStatusBarPadding) > 0.1) { _oldStatusBarPadding = newStatusBarPadding; StatusBarPaddingChanged?.Invoke(this, EventArgs.Empty); } base.LayoutChildren(x, y, width, height); }
/// <summary> /// Layouts the children. /// </summary> /// <param name="x">The x coordinate.</param> /// <param name="y">The y coordinate.</param> /// <param name="width">Width.</param> /// <param name="height">Height.</param> protected override void LayoutChildren(double x, double y, double width, double height) { if (_startingHeight < 0) { _startingHeight = StatusBarService.Height; } //var newStatusBarPadding = StatusBarPadding; var platformConfiguration = On <Xamarin.Forms.PlatformConfiguration.iOS>();//.SafeAreaInsets(); var safeAreaInsets = Xamarin.Forms.PlatformConfiguration.iOSSpecific.Page.SafeAreaInsets(platformConfiguration); if (safeAreaInsets != _oldStatusBarPadding) { _oldStatusBarPadding = safeAreaInsets; StatusBarPaddingChanged?.Invoke(this, EventArgs.Empty); } base.LayoutChildren(x, y, width, height); }