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,就是这么简单。这样状态栏的字体就变成白色了!

  • 相关阅读:
    响应式布局
    bootstrap--前端开发框架
    ADO.NET Entity Framework
    dns
    自动完成脚本
    一个Banner广告收缩效果
    对联广告2
    蓝色经典的对联广告代码
    Js弹性漂浮广告代码
    jquery悬停tab2
  • 原文地址:https://www.cnblogs.com/Free-Thinker/p/5124138.html
Copyright © 2011-2022 走看看