1

I'm developing a NativeScript application and recently upgraded my target SDK from 34 to 35 (Android 15 Preview). After this change, I noticed that the app layout started drawing behind the status bar and navigation bar, which was not happening when targeting SDK 34.

Before upgrading, the system bars were respected and the layout was displayed correctly. But with targetSdkVersion 35, UI elements now overlap with the system bars, making them difficult to interact with or see properly.

It looks like Android 15 (API 35) is enforcing edge-to-edge layout behavior more strictly, similar to what started in Android 11+ (API 30+).

What I want to know: Why is this behavior changing when moving from SDK 34 to 35?

How can I prevent my layout from drawing behind the system bars when targeting SDK 35?

Is there a recommended fix in NativeScript (Core) to handle this properly?

Any suggestions or best practices to handle this across Android 11+ and Android 15+ would be really helpful!

I'm using NativeScript Core (not Angular or Vue).

3
  • Please provide enough code so others can better understand or reproduce the problem. Commented Jun 6 at 21:33
  • Having this issue as well. Had to revert to older version until I can correct the problem. I use linearlayout on my pages and this is where the issue occurs. Upper item gets pushed up behind status bar. Commented Jul 30 at 2:52
  • i am talking specifically about the nativescript android project does anyone have any idea about that ? Commented Aug 13 at 15:35

2 Answers 2

0

Create App_Resources/Android/src/main/res/values-v35/styles.xml file and add below content

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- Application theme -->
    <!-- Added to prevent display from overlapping the navigation bar -->
    <style name="AppThemeBase35" parent="AppThemeBase">
        <item name="android:windowTranslucentNavigation">true</item>
        <item name="android:fitsSystemWindows">true</item>
        <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
    </style>

    <style name="AppTheme" parent="AppThemeBase35">
    </style>

</resources>
Sign up to request clarification or add additional context in comments.

Comments

0

A solution is in the making: https://github.com/NativeScript/NativeScript/pull/10774

In the meantime, you can disable edge-to-edge for your app for Android 15, by adding this to App_Resources/Android/src/main/res/values-35/styles.xml:

<style name="AppTheme" parent="AppThemeBase">
        <!-- Opt out of edge-to-edge mode on Android 15 -->
        <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
</style>

This won't work when targeting Android 16 / SDK level 36 anymore though.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.