nativescript-bottom-navigation icon indicating copy to clipboard operation
nativescript-bottom-navigation copied to clipboard

BottomNavigationBar not working with version 2.0.5 and my nativescript version is 6.0

Open prabh08 opened this issue 5 years ago • 2 comments

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.

prabh08 avatar Oct 19 '19 13:10 prabh08

Hi you should use BottomNavigationBar not BottomNavigation

henrychavez avatar Oct 20 '19 21:10 henrychavez

@henrychavez I also tried with BottomNavigationBar but its not working dear. Is there any another plugin with similar functionality.

prabh08 avatar Oct 21 '19 01:10 prabh08