
Your inner content must be covered by the status bar, and so you have to set fitsSystemWindows="false" to the coordinator (so it won’t apply top padding) and probably to the content itself. That is due to fitsSystemWindows="true" on the coordinator: it draws the background to the whole window, but adds top padding to the content so inner views are not covered by status bar. In fact, in my opinion, the white you see is not the status bar color, but rather your CoordinatorLayout background. fitsSystemWindows="true" : draws the view normally, under the status bar because of the window flags you have set, but adds a top padding so that content is drawn below the status bar and they don’t overlap.fitsSystemWindows="false" : draws the view normally, under the status bar because of the window flags you have set.When it comes to status bar, I think of fitsSystemWindows like so: there might be other fitsSystemWindows to change) so tell me if you have any problems. Tl dr Set android:fitsSystemWindows="false" at least to the root CoordinatorLayout and to the inner fragment container, might not be the final solution (i.e. In the end, I’ll of course make the toolbar and navbar semi transparent for a better visual effect… Third Screenshot: the main content should now scroll underneath the nav bar….Second Screenshot: I just started scrolling => the toolbar now should scroll away.First Screenshot: Shows the toolbar, nothing is scrolled.I added a black border as well so that you see where the activity ends… I use a light/dark base theme and theme everything by hand (because the user can select any color as primary/accent color), so don’t mind that the toolbar is white (it’s the default’s theme background color and primary color). Then I try to adjust the activity to programmatically get a translucent toolbar like following: void themeNavAndStatusBar(Activity activity)Īnd here is my fragment, that will be placed in the main activity: Create the activity and call setContent.The problem is, I can’t get the statusbar transparent in this case. all views that should fit the screen have the according android:fitsSystemWindows="true" in the xml layout.MainActivity, that holds a fragment and has a toolbar, that’s hiding when scrolling down.Specify that your view controller will implement the protocol, and add the prepareForPopoverPresentation and the popoverPresentationControllerDidDismissPopover functions to your code. The first task is to set our view controller as the delegate. UIPopoverPresentationControllerDelegate protocol has two functions that will serve this purpose.

Now that you have your popup view displaying normally, you’ll need to know when the popover is displayed and dismissed in order to change the views behind it.
#Shadow behind status bar ios how to
If you need a quick picture guide on how to configure a popover using storyboards, I suggest this Stack Overflow post for a nice visual guide on how to set it up.Ģ.

I am not going to go into detail on how you can configure a popover on iOS because I want to stay on topic. In this blog post, I’ll show you how you can dim not only the view behind the popover, but also the status and navigation bar. Specifically, the design wanted all the views behind the popover to be dimmed.īy default, iOS will put a radial gradient around the popup to draw attention to it, but I needed something more. The design for a recent project called for the contents of the popover view to be emphasized prominently.
