xamarin / Xamarin.Auth

Xamarin.Auth
Apache License 2.0
541 stars 351 forks source link

View under Navbar #283

Closed heathbm closed 6 years ago

heathbm commented 6 years ago

I'm using Xamarin Auth via dependency services which presents a new view where the user authenticates However, when the modal page appears and is fully visible, it jumps up and down revealing this black bar https://i.stack.imgur.com/VeR5e.png It quickly disapears and the page loads like so: https://i.stack.imgur.com/OYAtD.png where the top of the page is hidden. Thanks in advance

I've tried the following:

        UIWindow window = UIApplication.SharedApplication.KeyWindow;
        UIViewController viewController = window.RootViewController;
        UIViewController AuthVC = auth.GetUI();

        AuthVC.EdgesForExtendedLayout = UIRectEdge.None;
        AuthVC.ExtendedLayoutIncludesOpaqueBars = false;
        AuthVC.AutomaticallyAdjustsScrollViewInsets = false;

        viewController.EdgesForExtendedLayout = UIRectEdge.None;
        viewController.ExtendedLayoutIncludesOpaqueBars = false;
        viewController.AutomaticallyAdjustsScrollViewInsets = false;

        viewController.PresentViewController(AuthVC, true, null);
heathbm commented 6 years ago

Here is my temp fix, It still flashes but it looks correct after if has loaded. Does anyone know what would cause the black bar flashing? viewController.PresentViewController(AuthVC, true, new Action(() => { var MainUIView = AuthVC.View.Subviews[0]; var MainNavBar = AuthVC.View.Subviews[1]; var NavBarHeight = MainNavBar.Frame.Y + MainNavBar.Frame.Height; MainUIView.Frame = new CoreGraphics.CGRect(0, NavBarHeight, MainUIView.Frame.Width, MainUIView.Frame.Height - NavBarHeight); }));

newky2k commented 6 years ago

@heathbm could you please provide a sample demonstrating this issue so that we can investigate further.

Regards

newky2k commented 6 years ago

no response for two weeks