-
-
Notifications
You must be signed in to change notification settings - Fork 241
Modal: iOS statusbar should not change back to default white background w/ black text upon opening #340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Anyone know what's up with this? The top image is when a modal is open. I've tried setting fullscreen to true as well as false on the modal when it opens which has no affect on the statusbar resetting. |
@NathanWalker try setting "backgroundSpanUnderStatusBar" to true on the modally displayed page - solved this issue for me (in vanilla nativescript) |
I have the same issue, any update on that? |
I had the same issue. Setting "backgroundSpanUnderStatusBar" to true in the ngOnInit method and it worked well. It would be nice if this was a default option, perhaps set in the ModalDialogParams class. |
Could you tell me please, where to put this |
Looks like this has returned as a problem in {N} 4.x without a remedy at moment. Here’s a simple example repo which demonstrates the issue: https://github.com/NathanWalker/modal-issues Here is a playground setup similarly which shows different behavior: https://play.nativescript.org/?template=play-ng&id=dj3x53&v=5 Observations: /cc @sis0k0 @EmilStoychev |
@NathanWalker here is an example how you can achieve the desired functionality with latest version of tns-core-modules & nativescript-angular: https://github.com/manoldonev/ng-modal-test (this will work with [email protected] when released as well). Basically showModal(...) in HomeComponent opens a placeholder ng component HomeModalViewComponent that only contains Modal view status bar then can be customized in the HomeModalViewContentComponent via css: .action-bar, .page {
background-color: chocolate;
} , or via html: <ActionBar title="MODAL VIEW" backgroundColor="chocolate">
</ActionBar>
<StackLayout backgroundColor="chocolate">
<Button text="CLOSE MODAL" (tap)="onTap()"></Button>
</StackLayout> , or in code (if you have not defined ActionBar in html): export class HomeModalViewContentComponent implements OnInit {
constructor(private _params: ModalDialogParams, private _page: Page) { }
ngOnInit(): void {
// if you do not have ActionBar, you can change the status bar background like this
// this._page.backgroundColor = "chocolate";
}
// ...
} |
Thank you for this example @manoldonev |
@NathanWalker currently not. Generally for scenarios with shared modal dialogs (and no navigation within the modal) it would be best to bypass the approach with placeholder component that contains We are actively working on a different solution for NativeScript/NativeScript#5746 right now. |
Thanks @manoldonev - I was able to refactor couple projects to use It solves the white top bar :) I'll leave this open until #5746 is handled for now as that would likely provide ultimate flexibility to handle this way and the other way described. |
Ok so @manoldonev I take the above back So although in dev builds there are ways to make it more manageable, those solutions don't work when going to production with AoT build. In the end it would be nice to come up with a solution together which circumvents the need to define |
@NathanWalker the master branch of https://github.com/manoldonev/ng-modal-test/ now demonstrates a possible solution that does not need to define |
Right now, if you have a custom background-color ActionBar, opening a modal should not reset the statusbar color or should set it to the same as it was or could allow it to be custom set when the modal opens?

The text was updated successfully, but these errors were encountered: