简体   繁体   English

使用Nativescript的BottomNavigationBar无法正常工作

[英]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.

相关问题 使用片段和BottomNavigationBar - Using fragments and BottomNavigationBar GetMidleware 在底部导航栏上不起作用 - flutter - GetX - GetMidleware not working on bottomNavigationBar - flutter - GetX 使用 ConstraintLayout 和 ScrollView 的 Android BottomNavigationBar - Android BottomNavigationBar using ConstraintLayout and ScrollView Flutter:在BottomNavigationBar 中使用可扩展文本字段 - Flutter: Using Expandable Textfield with BottomNavigationBar 不同语言的字符串资源在 BottomNavigationBar 中不起作用 - String resources for different languages not working in BottomNavigationBar 隐藏BottomNavigationBar不能与设置为GridView的视图一起使用 - Hiding BottomNavigationBar not working with view set to a GridView nativescript android javacv无法正常工作 - nativescript android javacv not working 通过自定义按钮单击导航到导航片段后,BottomNavigationBar 无法正常工作 - BottomNavigationBar not working properly after navigate to navigation fragment by cutom button click 使用.extend()的NativeScript中的ClassNotFoundException - ClassNotFoundException in NativeScript using .extend() GridLayout中的本机脚本垂直对齐不起作用 - Nativescript vertical alignment in GridLayout not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM