zoukankan      html  css  js  c++  java
  • iOS8中如何将状态栏的字体颜色改为白色

    网上的一些方法在我这行不通,

    比如:

    UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent
    1、Set the UIViewControllerBasedStatusBarAppearance to YES in the .plist file.
    
    2、In the viewDidLoad do a [self setNeedsStatusBarAppearanceUpdate];
    
    3、Add the following method:
    
    -(UIStatusBarStyle)preferredStatusBarStyle{ 
        return UIStatusBarStyleLightContent; 
    }

    最后终于有个方法OK

    1、设置Info.plist中的View controller-based status bar appearance为YES

    2、然后在AppDelegate.swift中的

    func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool

    方法中加入:

    UINavigationBar.appearance().barStyle = UIBarStyle.Black

     

    OK,就是这么简单。这样状态栏的字体就变成白色了!

     

            

  • 相关阅读:
    每日日报40
    每日日报39
    每日日报38
    vue 0点定时网络请求
    js reduce
    时间选择器 element
    CTF-WEB:PHP 变量
    CTF-WEB:PHP 反序列化
    Java 异常类与捕获异常
    Java 面向对象:内部类
  • 原文地址:https://www.cnblogs.com/scaptain/p/3975134.html
Copyright © 2011-2022 走看看