iOS buttons become unclickable after making a floating layout - nativescript

I'm creating a custom action bar and my idea is that the actionbar must be transparent (thats why I can't/don't want to use the native one) and behind the action bar there must be content (an image in this case).
I tried multiple ways and all of them with the same result, the iOS button become unclickable for no reason.
Ok, so I have an AbsoluteLayout inside I have GridLayout fixed on top as the custom actionbar and then a ScrollView with 100% width and height, inside the scrollview there's some content. The problem is as soon as I put a button inside the GridLayout this become unclickable only on iOS because in Android works just fine.
Let me show you my example with some code:
<Page actionBarHidden="true">
<GridLayout rows="50, *" backgroundColor="red" top="0" left="0" height="50" id="bar">
<Button text="click" #tap="goToDetailPage" id="buttondelsous"></Button>
<ScrollView backgroundColor="blue" width="100%" height="100%" top="0" id="content">
<Label text="this is behind"></Label>
As for the styles forcing the custom actionbar being in front of the scrollview I have:
#bar {
z-index: 5;
width: 100%;
#content {
z-index: 2;
This looks like this on Android:
Same way on iOS but the button "Click" is not working, like if it was behind something..
Any idea on how to fix this or any other approach to get what I need? Remember behind the action I must be able to place content (like a background image that I don't want to place in the Page tag itself but in another layout)

A wise man once told me that Nativescript stacks elements in the order you list them. Try flipping around the order so the button is listed last in the template. I believe you won't even need the z-index line if you flip the order around.
should look like
<Page actionBarHidden="true">
<ScrollView backgroundColor="blue" width="100%" height="100%" top="0" id="content">
<Label text="this is behind"></Label>
<!-- I'm listed second so I will be on top even though I have row="0" -->
<GridLayout rows="50, *" backgroundColor="red" top="0" left="0" height="50" id="bar">
<Button text="click" #tap="goToDetailPage" id="buttondelsous"/>


How to create bottom navigation bar

I am trying to create a simple fixed bottom navigation bar in my app using the nativescript-bottom-navigation plugin - and keep getting errors. It will not build, and of the many errors displayed in that horrid EXCEPTION black screen, is "AHBottomNavigation is not a constructor".
I simply want 3 icons in the fixed nav: Home, Account, Programs
I am using pure Javascript, and the demo tutorial is in TypeScript. This may be the issue.
Steps I Followed
I installed the plugin using the command line.
I added my icons manually to the resources folder
My Search Page [ where the nav will be located ]
<ActionBar class="action-bar">
Use the NavigationButton as a side-drawer button in Android
because ActionItems are shown on the right side of the ActionBar
<NavigationButton ios:visibility="collapsed" icon="res://menu" tap="onDrawerButtonTap"></NavigationButton>
Use the ActionItem for IOS with position set to left. Using the
NavigationButton as a side-drawer button in iOS is not possible,
because its function is to always navigate back in the application.
<ActionItem icon="res://navigation/menu"
<Label class="action-bar-title" text="Search"></Label>
<GridLayout columns="*"
rows="*, auto">
<StackLayout row="0">
<Label text="content"></Label>
<bottomNav:BottomNavigation tabs="{{ tabs }}"
and here is...
const observableModule = require("tns-core-modules/data/observable");
const SelectedPageService = require("../shared/selected-page-service");
const BottomNavigation = require("nativescript-bottom-navigation").BottomNavigation;
const BottomNavigationTab = require("nativescript-bottom-navigation").BottomNavigationTab;
const OnTabSelectedEventData = require("nativescript-bottom-navigation").OnTabSelectedEventData;
function SearchViewModel() {
const viewModel = observableModule.fromObject({
/* Add your view model properties here */
tabs: [
new BottomNavigationTab('First', 'ic_home'),
new BottomNavigationTab('Second', 'ic_view_list'),
new BottomNavigationTab('Third', 'ic_menu')
return viewModel;
module.exports = SearchViewModel;
I cannot understand the error screen displayed to me on my device ( I am testing on an Android device ).
Does anyone see where I am going wrong? Any pointers would be greatly appreciated.
Thank you.
You can use <DockLayout> to achieve the same without using any plugin.
<DockLayout height="100%">
<!-- bottom navigation buttons -->
<StackLayout dock="bottom" height="50" class="bottom-navigation" orientation="horizontal">
<Button text="Home"/>
<Button text="Accounts"/>
<Button text="Programs"/>
<!-- other top content -->
<Button dock="top" text="Other Content"/>
then use CSS to normalize the layout:
.bottom-navigation {
.bottom-navigation button {
width: 33.33%;
border-color: transparent;
border-width: 1;
You can replace <Button> with <StackLayout> to add icon and text.
Playground Demo

How to build a fixed footer in NativeScript-Vue?

I would like to have a fixed footer in a page, but I tried with
and a
position: absolute;
bottom: 0;
and in the container parent
position: relative
but nothing happened.
I tried with
<AbsoluteLayout bottom="0">
and nothing happened again.
Someone knows how to do this? Thank you!
The <AbsoluteLayout> places elements absolutely inside it. With NativeScript, we have to use Layout Containers to place elements inside them.
The best layouts to achieve what you want zare:
1) <DockLayout>, e.g.
<Label dock="bottom" height="60" backgroundColor="yellow" text="footer"/>
<Label text="rest of the content"/>
2) <GridLayout>, e.g.
<GridLayout columns="*, 60">
<Label col="0" text="rest of the content"/>
<Label col="1" text="footer"/>
Please study the layout containers documentation.

Text wont show inside a label nested in an AbsoluteLayout

Im building a component to show users profile pictures stacked horizontally.
in a case where user doesn't have a profile photo, his 1st name letter will show in a bubble inside the stack.
Im having difficulty showing the text inside the bubble.
the container for the bubble is a layout with circle class and inside of it a Label containing the text.
Would highly appreciate any help in this regards since it has exhausted me :XXX
<AbsoluteLayout orientation="horizontal" style="background-color: #00fdd6">
<ng-template ngFor let-user [ngForOf]="users|limit:lengthLimit" let-i="index">
<Image *ngIf="user.profile_photo" [src]="getImageUrl(user)" class="img-circle" height="50" width="50"
<RelativeLayout *ngIf="!user.profile_photo" style="border: #0000fe 5px solid; background-color: green;"
class="img-circle" height="100" width="100" top="-25" left="{{stackProfileLetterBubble(i)}}">
<Label text="M" HorizontalOptions="CenterAndExpand" VerticalOptions="Center" TextColor="White" FontSize="24"></Label>
Attached a view of the ui

How to position element at the bottom of Absolute Layout in NativeScript?

I want to position an element at the bottom of the screen in Absolute Layout in NativeScript.
I have this code:
latitude="{{ map.latitude }}"
longitude="{{ map.longitude }}"
zoom="{{ map.zoom }}"
padding="{{ map.padding }}"
<!-- More XML -->
style="background-color: red;">
<Label text="TITLE"></Label>
I figured out that there is no bottom attribute for AbsoluteLayout... Here is the picture of what I want to create:
So how to arange items like in the picture, especially the bottom one?
EDIT: I should note that dimensions of this bottom rectangle may not be always same....
I did something similar one day, programmatically & with Angular, maybe this can help.
If you don't want to use a GridLayout you can try to get height of your bottom element and of the screen, then place your element from the top with a simple calcul : screen's height - bottom element's height (- more if you want some padding). You can use two types of values : DIPs and pixels. If you're using pixels, you need to convert your values into DIPs by using the screen scale.
Something like this (I didn't test the code I'm giving you, it's just an example) :
1] add an id to your bottom element so you can access it inside your component :
<StackLayout #bottomElt></StackLayout>
2] update your component to set element position inside your absolute layout
// you need ElementRef, OnInit and ViewChild
import { Component, ElementRef, OnInit, ViewChild, ViewContainerRef } from "#angular/core";
import { AbsoluteLayout } from "ui/layouts/absolute-layout";
import { StackLayout } from "ui/layouts/stack-layout";
// you need access to screen properties
import { screen } from "tns-core-modules/platform";
export class YourComponent implements OnInit {
// add access to element inside your component
#ViewChild("bottomElt") bottomElt: ElementRef;
// create variable to access bottom element properties
bottomContainer: StackLayout;
// set bottom element position after view init
// example : inside ngOnInit function (for Angular version)
ngOnInit(): void {
this.bottomContainer = <StackLayout>this.bottomElt.nativeElement;
// using DIPs values only
AbsoluteLayout.setTop(this.bottomContainer, (screen.mainScreen.heightDIPs - Number(this.bottomContainer.height)));
// using pixels and screen scale
// this way you can get height without knowing it
AbsoluteLayout.setTop(this.bottomContainer, (screen.mainScreen.heightDIPs - (Number(this.bottomContainer.getMeasuredHeight()) / screen.mainScreen.scale)));
More information about screen values :
Alternative way
Instead of using AbsoluteLayout, you can use a GridLayout to set a bottom bar, with two rows : one with a wildcard size and the other with auto size so it can fit your bottom bar height everytime it changes. I did it this way in a mobile application to get a menu at the bottom in Android and IOS :
<GridLayout rows="*, auto" width="100%">
<AbsoluteLayout row="0" orientation="vertical">
<!-- YOUR CONTENT (maps & ScrollView) -->
<!-- YOUR BOTTOM BAR (StackLayout). Don't forget to add row="1" -->
<StackLayout #bottomElt row="1">[...]</StackLayout>
Another option is using FlexboxLayout in your AbsoluteLayout container like this:
<FlexboxLayout flexDirection="column" justifyContent="space-between" height="100%">
<!-- More XML -->
style="background-color: red;">
<Label text="TITLE"></Label>
This is the absolute best solution, got it from one of the devs:
<GridLayout rows="*,auto">
<ItemTakingFullScreen rowSpan="2"/>
<ItemShownUnder row="1"/>
<ItemShownAbove row="1">
Basically, you can use grid layout and have a item take up multiple grid spaces, sharing them with some other item.
here is the best solution
wrapper all the elements in an absolutelayout with width and hieght to 100% and maybe add a gridlayout to hold the main content .
<AbsoluteLayout width='100%' height='100%'>
<StackLayout width='100%' hieght='100%' left='0' top='0'>
//add you structure here
add your fixed element here
<image src='add the float item'/>

Native Script ScrollView and AbsoluteLayout

Im new to NS and I have a project. I want a Button floating inside a ScrollView.
<StackLayout orientation="vertical">
<AbsoluteLayout >
<Button top="0" left="0" right="0" text="Test" style="font-size: 10; margin:5; " />
<Label text="Trending Now: " cssClass="trending-label" />
<Repeater items="{{ categories }}">
But its not working. The Button is also scrolling. I want the Button to be floating on ScrollView. Thank you.
The reason why the button is scrolling together with the other items is that everything is situated in a ScrollView. In order to have only the Label and the Repeater scrolling, the Button should be placed outside of it.
Another thing I have noticed is that on the Button, simultaneously are applied left and right alignment, which might cause a problem.
I made a possible implementation of the float button, which you can check here.