Action Bar in Nativescript positioned below the status bar

While working on creating a Nativescript Vue app, I encountered an issue with my Android 10 device (Samsung S10+), where the status bar was partially covering the Action Bar.

This problem is also visible in the playground app.

https://i.sstatic.net/VBsi8.jpg

To resolve this issue, I had to remove the transparent status bar option in the android config. However, this meant sacrificing the dynamic color feature of the status bar.

Has anyone else come across this problem?

Answer №1

If you want to customize the notification bar behavior in Nativescript, head over to

APP_resources/Android/src/main/res/values-21/styles.xml
. This is where you can tweak settings like making the notification bar non-translucent and adjusting padding when no ActionBar is present.

https://i.sstatic.net/Yy6PR.png

For a detailed guide on these configurations, check out this link: https://github.com/NativeScript/NativeScript/issues/6795

PS1: Below is the code snippet for your convenience:

<!-- Application theme -->
<style name="AppThemeBase21" parent="AppThemeBase">
    <item name="android:windowTranslucentStatus">false</item>
    <item name="android:datePickerStyle">@style/SpinnerDatePicker</item>
    <item name="android:timePickerStyle">@style/SpinnerTimePicker</item>
    <item name="android:windowLayoutInDisplayCutoutMode">default</item>
</style>

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

<!-- Default style for DatePicker - in spinner mode -->
<style name="SpinnerDatePicker" parent="android:Widget.Material.Light.DatePicker">
    <item name="android:datePickerMode">spinner</item>
</style>

<!-- Default style for TimePicker - in spinner mode -->
<style name="SpinnerTimePicker" parent="android:Widget.Material.Light.TimePicker">
    <item name="android:timePickerMode">spinner</item>
</style>

<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
    <item name="android:elevation">4dp</item>
    <!-- <item name="android:paddingTop">24dp</item> -->
</style>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips on sending data with a unique identifier to the backend through a route parameter

Can anyone help me figure out how to send a message to a specific backend route parameter while passing the current ID? I'm not sure how to inform the system about this ID. Here's the Vuex action: postMessage({commit}, payload, id) { axios.pos ...

An issue is persisting with the axios request as it does not seem to

I am currently using Vue.js with Vee Validate on the frontend and Laravel 10 on the backend. I am encountering an issue when trying to call my register API - I need to display the validation errors returned from the backend API. The response is structured ...

Tips for determining the height of individual lines within an edit text box

I am looking to achieve an animation effect on the keyboard similar to how Telegram does it when a new line is added or removed. Currently, I have implemented the animation like this: private void doAnimation(int linesCount, String s){ Toast.makeTe ...

Access array information using AngularJS

Sorry for any language issues. I am trying to figure out how to extract an array data from AngularJS in order to save it using Node.js. This is my AngularJS script: angular.module('myAddList', []) .controller('myAddListController&apos ...

Two consecutive ajax requests returning data

I am currently utilizing ajax for successive requests and I am in need of a callback function to be executed after all the requests have been completed. function doAjaxRequest(data, id) { // Get payment Token return $.ajax({ type: "POST", ...

Ways to avoid executing JavaScript code that is outputted in PHP

My question relates to the code snippet below, which is obtained via the jquery Data object on a php page. echo " var $d = $('<div/>', { id: 'hi' + $('#textResp').children().length, class: 'even ...

What is the best way to invoke an Angular scope function using JavaScript?

Is there a way to trigger a function in Angular from JavaScript? I have a primary controller with a function that I want to execute from JavaScript code. For instance, within my controller file, the code looks like this: app.controller('mainCtrl&apos ...

Update a DIV when ajax call is successful

I have a webpage with a specific heading: <div class="something"><? some php code ?></div> On this page, there is also an ajax function that performs a certain task: <script> $(document).ready(function () { $(document).ajaxSta ...

Do we need to use aria-labelledby if we already have label and input associated with "for" and "id"?

Here is the HTML structure for the Text Field component from Adobe Spectrum: The <label> element has a for attribute and the <input> has an id which allows screen readers to read out the label when the input is focused. So, why is aria-label ...

Responsive Gallery Grid Slider with uniform height boxes

Looking to develop a responsive gallery grid slider with equal height boxes. For instance, at 650px wide or wider, display 3 columns and 2 rows. When the width is 550px or less, switch to 2 columns and 3 rows. If the width is 450px or less, go down to 1 ...

Canvas flood fill is having trouble reaching the edges

While utilizing a flood fill algorithm to fill circles drawn on the canvas, I've encountered an issue where the algorithm fails to fill right up to the edge of the circle. Here is the implementation of the algorithm based on this blog post: function ...

The static files are being received by Django but are not functioning properly

I've been working on a project using django 1.7, and below is my settings.py configuration: STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(BASE_DIR, "assets"), ) STATIC_ROOT = "absolute/path/to/static" In the 'assets&apo ...

Modify the HTML select tag to toggle from a selected checkbox

What should I do when a certain option is checked in the checkbox, and that label needs to be shown in the select tag? https://i.stack.imgur.com/ZxRNF.png Checkbox input <input type="checkbox" class="toggle-product pull-right" @if(!isset($restrictedPr ...

Executing an event in Javascript or triggering with Jquery- the process of initiating an event once a value is sent to an input box by Javascript

How do you trigger an event when a JavaScript-passed value is entered into an input box? <!DOCTYPE html> <html> <body> <p>Type something in the text field to activate a function.</p> <input type="text" id="myInput" oninp ...

Angular - the utilization of expressions in view templates

Exploring Angular for the first time and attempting to create a Single Page Application (SPA). I have included the route module, which seems to be functioning properly. However, the templates are not interpreting Angular expressions as expected - for examp ...

Calculating the total length of an SVG element using React

Looking to animate an SVG path using React (similar to how it's done in traditional JavaScript: https://css-tricks.com/svg-line-animation-works/), but struggling when the path is created using JSX. How can I find the total length of the path in this s ...

What is the best way to incorporate an npm module in a django-admin widget without the need to install node?

Background I am working on a Django app and need to create an admin widget. The widget will display text in a unique terminal-style format to show forwarded logs from an analytics process managed by Django (using the django-twined extension). To achieve ...

Force restart broken socket within Node.js program using Socket.IO programmatically

I have a simple one-to-one client and server Node.js based application. The Node.js is running on Linux (Intel Edison). I am attempting to automatically reboot the Linux server whenever the socket connection is broken. Is this achievable? Below is my unco ...

Performance of Nested Menus: A Technological Perspective

In an effort to condense a long stay, the marketing team is requesting our entire sitemap of 5000 pages be accessible through one menu. Despite a year of resistance, we have come to accept that this is inevitable and are now exploring potential technologie ...

Angular JS presents an exciting feature called Multiple Filters, which allows

I have a data representation application that displays information in table format with columns id, name, price, quantity The data is presented using ng-repeat. You can view it on this Plunker <body ng-controller="myController"> <h1>Data< ...