How make the status bar opaque on Xamarin for app without navigation bar - ios

I have a app that only have a form with a web view. When the web view scroll (it have a white background) the content slide behind the status bar, turning it transparent (only the battery indicator is visible. The rest text of the status bar was white and now is not visible).
I need the status bar to be opaque, and the content disappear behind it.
I try setting Status bar style to default, opaque style and none work. Neither putting the background color of the view.

Related

iOS is it possible to have status bar that is half light and half dark

I have status bar where left part is on dark background and I have there light text content. But right part of status bar background is on the other hand white and I would like to have there black text.
Is it possible to set different colours of status bar content in left and right half. In left I have dark menu and in right I have content on white background.
I found solution but I have Split View Controller and then I can override in preferredStatusBarStyle differently in Master and Detail view controller. In general I think it will not be possible while having single view controller

iOS status bar background overlaps UIAlertController

The main view of my app is a scrollable UICollectionView embedded in a UITabBarController. I'm not using a navigation bar and when the user scrolls he sees the cells behind the status bar, because the status bar has no background.
I've used UIApplication.shared.statusBarView?.backgroundColor = .white in my AppDelegate to apply a background and to make the status bar look like desired.
This works fine, but doesn't look nice when you're presenting a UIAlertController.
The white status bar stays above the dimmed background.
Is there a better way to apply a background to the status bar or a way to keep it behind the UIAlertController background?
You can try to use a UIView with a background color at the top of your presenting UIView.
Height of status bar can come from UIApplication.shared.statusBarFrame. And update your view size when receiving UIApplication.didChangeStatusBarFrameNotification.

Change background color of viewcontroller but not top area with clock

I want to make my whole ViewController grey except I want the top area where it shows CARRIER and the current time to remain white. Is the only way just to stick a View that covers everything except that area, and set it to grey, or is there some way to set the entire background to grey and only set that one strip to white
The "top area with clock" is called a status bar. That bar is transparent and is displayed as the topmost view in a window. This means that nothing can cover the status bar.
You can show, hide and change the appearance of the status bar (changing the content from Light to Dark implies that the text colour within your status bar will be either white or black) by sending the appropriate message to the [UIApplication sharedApplication] object.
Now that you know a little bit about the status bar, I can answer your question:
In order to have a different background under the status bar than on the rest of the screen, you need to add a view with the frame [[UIApplication sharedApplication] statusBarFrame]. Then you can colour the view property of the view controller differently than the view underneath the status bar.
Set your ViewController's view's background color to gray. Then add a white subview to it matching the status bar's frame.

Opaque navigation bar has black view behind it

I'm manually hiding the navigation bar based on the scroll offset of the scrollview and it works 100% fine with a translucent navbar. However, if it's opaque (I need it to be to get the background colour correct), it produces this black bar which I can't seem to get to go away.

UIDocumentInteractionController - Change background Color and prevent status bar popup

When I use the UIDocumentInteractionController it's background color is always white in the beginning and when I tap it, it gets black (and back when tapped again).
Can I somehow invert this or even set a custom background color for both modes?
Another interesting bug is that once I touch the screen the status bar (which I have disabled) pops back up. So white screen with document --> tap screen --> black background with status bar --> tap white screen withs status bar.
Once I dismiss that UIDocumentInteractionController, I disable the status bar again but it looks really ugly.
I've got the info.plist set up correctly with UIViewController-wise decided status bar appearence set to NO.

Resources