[英]BottomNavigationBar using Nativescript is not working
I am beginner to Nativescript, I am trying to use BottomNavigationBar in my project. 我是Nativescript的初学者,我正在尝试在项目中使用BottomNavigationBar。 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. 步骤1:在我的项目路径上执行的npm i nativescript-bottom-navigation->步骤2:添加了图标(出于测试目的,我仅添加了一张图片“ ic_home”,并且我仅将该图标用于所有项目)用于android& iOS在您的App_Resources目录中。 Step 3: As guided in this link added html file and typescript codes 步骤3: 按照此链接中的指导,添加了html文件和打字稿代码
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 com.tns.NativeScriptException:调用js方法onCreateView失败
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 TypeError:AHBottomNavigation不是构造函数文件:“ file:///data/data/org.nativescript.bottomsheet/files/app/tns_modules/nativescript-bottom-navigation/bottom-navigation.js,第22行,第26列
================== ==================
Why not use the nativescript Tab View? 为什么不使用nativescript选项卡视图? https://docs.nativescript.org/angular/code-samples/ui/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? 我猜您想将标签放在android平台的底部吗? 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 在最新版本的nativescript(4.0)中,您现在可以通过设置androidTabsPosition="bottom"
将选项卡放在android的androidTabsPosition="bottom"
,例如,请参见以下链接: https : androidTabsPosition="bottom"
码样本/ UI /制表视图#翼片位
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.