简体   繁体   English

TabView没有标签

[英]TabView without the tabs

My app displays two views of the same info. 我的应用程序显示相同信息的两个视图。 Thought I use TabView - but space is as a premium - any way to hide the tab bar itself. 我以为我使用TabView - 但空间是一种溢价 - 任何隐藏标签栏本身的方法。 I'll do it programmatically via a menu. 我将通过菜单以编程方式进行。

I'm not tied to the idea of a TabView. 我不喜欢TabView的想法。 Any other suggestions? 还有其他建议吗? Basically need to switch to a different view of the same underlying data. 基本上需要切换到相同底层数据的不同视图。

This is the code in one of my existing applications I'm writing; 这是我正在编写的一个现有应用程序中的代码; I can't promise the iOS side works as I haven't actually tested this screen in iOS yet, but I believe the code should work for iOS also. 我不能保证iOS方面的工作,因为我还没有在iOS中测试过这个屏幕,但我相信代码也适用于iOS。

exports.onNavigatedTo = function(args) {
  var tabview = args.object.getElementById('tabview');

  if (global.android) {
    tabview._tabLayout.setVisibility(android.view.View.GONE);
  } else {
    tabview._ios.tabBar.setHidden(true);
  }
};

` `

Please note the declarative ui xml file has the tabview element using the id of "tabview", I've got the "onNavigatedTo" event being used and I'm also using my opensource NativeScript-Dom plugin which gives me the "getElementById" function. 请注意声明性ui xml文件的tabview元素使用id“tabview”,我已经使用了“onNavigatedTo”事件,我也使用了我的开源NativeScript-Dom插件,它给了我“getElementById”函数。 However, in this specific case you could easily replace that piece of code by the build in function to get an id from a view... 但是,在这种特定情况下,您可以通过内置函数轻松替换该段代码以从视图中获取id ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM