NativeScript / NativeScript/NativeScript
SafeArea on Android with notch
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 25.7k
- Forks
- 1.7k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 35
Description
Hi to all,
I am using latest NativeScript with Sidekick:
Version: 1.14.1-v.2018.11.23.3 (latest)
NativeScript CLI version: 5.1.0
CLI extension nativescript-cloud version: 1.15.0
CLI extension nativescript-starter-kits version: 0.3.5
I have a problem with Android (Pixel 3 XL, android P) where phones notch cuts into ActionBar.
Application is Drawer Navigation application which comes with Native Script (built in).
Check attached preview. You can not see the notch but it cuts over "Home" action bar title.

I have tried with CSS top margin 50 but then it will effect other phones which does not have notch or notch height is different.
Is there a proper way to deal with this?
I could not find any solution. I think that NativeScript should be able to handle this by default, but it does not.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue on a Pixel 3 XL running Android P with the NativeScript Drawer Navigation application, then start by tracing how the Android ActionBar handles the notch and safe-area insets. Done means the Home title no longer overlaps the notch while preserving correct positioning on phones without a notch or with different notch heights.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100