Open prabh08 opened 5 years ago
home.xml
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:mdc="nativescript-bottom-navigation" loaded="onNavigatedToMainTab" class="page"> <GridLayout rows="*, auto"> <StackLayout row="0"> <Label text="content"></Label> </StackLayout> <mdc:BottomNavigation tabs="{{ tabs }}" activeColor="green" inactiveColor="red" backgroundColor="black" tabSelected="tabSelected" row="1" ></mdc:BottomNavigation> </GridLayout> </Page>
home.js
var Observable = require("data/observable").Observable; var BottomNavigationTab = require('nativescript-bottom-navigation').BottomNavigationTab; var TabSelectedEventData = require('nativescript-bottom-navigation').TabSelectedEventData; function onNavigatedToMainTab(args) { let page = args.object; page.bindingContext = { tabs: [ new BottomNavigationTab({ title: 'First' }), new BottomNavigationTab({ title: 'Second' }), new BottomNavigationTab({ title: 'Third' }), ], }; } function tabSelected() { console.log('tab selected ' + TabSelectedEventData.newIndex); } exports.onNavigatedToMainTab = onNavigatedToMainTab; exports.tabSelected = tabSelected;`
I am getting this error on Android build with webpack.
Attempt to invoke virtual method 'int android.view.View.getVisibility()' on a null object reference
Please help me on this.
Hi you should use BottomNavigationBar not BottomNavigation
BottomNavigationBar
BottomNavigation
@henrychavez I also tried with BottomNavigationBar but its not working dear. Is there any another plugin with similar functionality.
I am getting this error on Android build with webpack.
Attempt to invoke virtual method 'int android.view.View.getVisibility()' on a null object reference
Please help me on this.