美文网首页
自定义导航条,状态栏

自定义导航条,状态栏

作者: 半江瑟瑟 | 来源:发表于2016-09-22 18:06 被阅读19次

    设置任何界面下的电池栏前景颜色都是白色

    application.setStatusBarStyle(.LightContent, animated: true)

    Paste_Image.png
    参考文章:
    http://beyondvincent.com/2013/11/03/2013-11-03-120-customize-navigation-status-bar-ios-7/
    alertTitleLabel.font = self.alertTitleLabelFont()
        let mstr = NSMutableAttributedString(string: alertTitleLabel.text!)
        let par = NSMutableParagraphStyle()
        par.alignment = .Justified
        par.lineSpacing = 6
        let dict = [NSParagraphStyleAttributeName:par,
                    NSFontAttributeName:self.alertContentLabelFont(),
                    NSUnderlineStyleAttributeName:NSNumber.init(integer: NSUnderlineStyle.StyleNone.rawValue)]
        //Cannot convert value of type 'NSUnderlineStyle' to expected argument type 'Int' --->用rawValue 解决枚举转Int
        mstr.addAttributes(dict, range: NSMakeRange(0, mstr.length))
        alertContentLabel.attributedText = mstr
    

    label文章左右对齐
    http://www.jianshu.com/p/38a6fd46fb9c
    http://www.jianshu.com/p/06722622073b

    IOS集成第三方TTF字体库
    参考文章:
    http://www.jianshu.com/p/7979cc606bd5

    相关文章

      网友评论

          本文标题:自定义导航条,状态栏

          本文链接:https://www.haomeiwen.com/subject/wovzettx.html