Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1946,31 +1946,20 @@ public Container(View view, UINavigationBar bar) : base(bar.Bounds)
ClipsToBounds = true;
}

UIEdgeInsets CalculateUIEdgeInsets()
public override UIEdgeInsets AlignmentRectInsets
{
var type = UIBarButtonSystemItem.FixedSpace;
var spacer = new UIBarButtonItem(type, (_, _) => { });
spacer.Width = SystemMargin + (OperatingSystem.IsIOSVersionAtLeast(11) ? 8 : -16);

nfloat screenWidth = UIScreen.MainScreen.Bounds.Size.Width;

if (!OperatingSystem.IsIOSVersionAtLeast(11) && screenWidth < 375)
{
// 3.5 and 4 inch
spacer.Width += 8;
}
else if (screenWidth >= 414)
get
{
// 5.5 inch
spacer.Width -= 4;
if (_child?.VirtualView is IView view)
{
var margin = view.Margin;
return new UIEdgeInsets(-(nfloat)margin.Top, -(nfloat)margin.Left, -(nfloat)margin.Bottom, -(nfloat)margin.Right);
}
else
{
return base.AlignmentRectInsets;
}
}

return new UIEdgeInsets(0, spacer.Width, 0, spacer.Width);
}

public override UIEdgeInsets AlignmentRectInsets
{
get => CalculateUIEdgeInsets();
}

void OnTitleViewParentSet(object sender, EventArgs e)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading