MasterDetailPage color bar above menu?

phantonymphantonym Member ✭✭
edited June 2018 in Xamarin.Forms

How to color the bar above the menu?

Also:
On iPhone, when click a menu item, the detail page navigates to another page, before the menu closes. It takes a very long time. How to fix it?
Using Prism.

Best Answer

  • phantonymphantonym ✭✭
    edited June 2018 Accepted Answer

    Solution:

    UIView statusBar = UIApplication.SharedApplication.ValueForKey(new NSString("statusBar")) as UIView;
    if (statusBar.RespondsToSelector(new ObjCRuntime.Selector("setBackgroundColor:")))
    {
        statusBar.BackgroundColor = color;
    }
    

Answers

  • M_Shah04M_Shah04 USMember ✭✭✭

    @phantonym Do you want to apply color to the statusbar (The bar that displays time in your screenshot)?

  • phantonymphantonym Member ✭✭
    edited June 2018 Accepted Answer

    Solution:

    UIView statusBar = UIApplication.SharedApplication.ValueForKey(new NSString("statusBar")) as UIView;
    if (statusBar.RespondsToSelector(new ObjCRuntime.Selector("setBackgroundColor:")))
    {
        statusBar.BackgroundColor = color;
    }
    
  • AdrianGhiAdrianGhi USMember ✭✭
    edited June 2018

    UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false); UIApplication.SharedApplication.SetStatusBarHidden(false, false);

    I used this in AppDelegate, and it looks better :)

Sign In or Register to comment.