0

I am beginner to Nativescript, I am trying to use BottomNavigationBar in my project. Below steps i have followed.

Step 1: npm i nativescript-bottom-navigation -> executed on my project path Step 2: added the icons(As for testing purpose i have added only one image 'ic_home' and i only used that icon for all items) for android & iOS in your App_Resources directory. Step 3: As guided in this link added html file and typescript codes

But I am getting below error while trying to run app. Please help me to come out from this rid.

==================
An uncaught Exception occurred on "main" thread. com.tns.NativeScriptException: Calling js method onCreateView failed

TypeError: AHBottomNavigation is not a constructor File: "file:///data/data/org.nativescript.bottomsheet/files/app/tns_modules/nativescript-bottom-navigation/bottom-navigation.js, line: 22, column: 26

==================

1 Answer 1

1

Why not use the nativescript Tab View? https://docs.nativescript.org/angular/code-samples/ui/tab-view

I'm guessing you want to put the tabs at the bottom on android platform? well in the latest version of nativescript (4.0) you can now have the option to put the tab at the bottom on android by setting androidTabsPosition="bottom" see this link for example: https://docs.nativescript.org/angular/code-samples/ui/tab-view#tabs-position

Sign up to request clarification or add additional context in comments.

2 Comments

I have found a couple issues with TabView for android. Do you know if you can disable horizontal scrolling of tabs when you have like 5+ tabs? Also, I found that when using position bottom, the tabs float up to top of keyboard when it is displayed.
yeah, there are confirmed issues with the current tab implementation for iOS/Android. But there's an ongoing plan to create a new tab implementation, you can check track it here github.com/NativeScript/NativeScript/tree/tabs-redesign . But on my side I created a custom tab using StackLayout or GridLayout.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.