【问题标题】:How to toggle the UITabBar translucent property with NativeScript?如何使用 NativeScript 切换 UITabBar 半透明属性?
【发布时间】:2018-11-01 19:34:15
【问题描述】:

我希望我的 TabView 栏与我的布局颜色相同。在 NS 中添加了一个平面布尔值,以便通过 ActionBar 实现这一点,但是我怎样才能通过我的标签栏实现这一点呢?如果我将 tab-background-color 属性设置为黑色,我希望它实际上是黑色,而不是深灰色,因为这里解释了半透明属性:https://developer.apple.com/documentation/uikit/uitabbar/1623458-translucent?language=objc

我找到了很多关于解决 ActionBar 问题的帖子/文章,但还没有看到任何关于选项卡的内容

【问题讨论】:

    标签: nativescript


    【解决方案1】:

    在 TabView 的加载事件上试试这个

    onTabViewLoaded(args) {
       const tabView = args.object;
       if (tabView.ios) {
         tabView.ios.tabBar.translucent = true; // false;       
       }
    }
    

    【讨论】:

    • 如此简单。我刚刚有了这个解决方案,我自己还没有完全做到。第一次浏览 NativeScript 源代码。不过现在一切都好!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多