首页 > 解决方案 > 无法更改 iOS NativeScript 中的状态栏颜色

问题描述

我正在尝试将 iOS 中状态栏的颜色文本更改为白色。这是我到目前为止所做的:

import { topmost } from "ui/frame";

export class HomeComponent implements OnInit {

    constructor() {

    }
    ngOnInit()
    {
        if(app.ios)
        {
            var navBar = topmost().ios.controller.navigationBar;
            navBar.barStyle = 1;
        }
    }
}

但这似乎不起作用。有什么建议么 ?

标签: nativescript

解决方案


推荐阅读