zoukankan      html  css  js  c++  java
  • swift-UILabel

     1 // Mark: 2. 创建label
     2     private func creatLabel(title: NSString)->UILabel{
     3                 /// 创建label
     4         let titleL = UILabel(frame: CGRectMake(100, 64, 200, 60))
     5         
     6         titleL.text = title as String
     7         titleL.textColor = UIColor.redColor()
     8         titleL.backgroundColor = UIColor.yellowColor()
     9         titleL.layer.cornerRadius = 10.0
    10         titleL.layer.masksToBounds = true
    11         titleL.textAlignment = NSTextAlignment.Center
    12         titleL.font = UIFont.systemFontOfSize(16.0)
    13         // 阴影
    14         titleL.shadowColor = UIColor.cyanColor()
    15         titleL.shadowOffset = CGSizeMake(-2, 2)
    16         // 省略方式
    17         titleL.lineBreakMode = NSLineBreakMode.ByTruncatingTail
    18 //        titleL.adjustsFontSizeToFitWidth = true
    19         titleL.numberOfLines = 2
    20         
    21         // 富文本
    22         let attr = NSMutableAttributedString(string: "NSMutableAttributedStringNSMutableAttributedStringNSMutableAttributedString")
    23         
    24         attr.addAttribute(NSFontAttributeName, value: UIFont.boldSystemFontOfSize(25.0), range: NSMakeRange(0, 6))
    25         attr.addAttribute(NSForegroundColorAttributeName, value: UIColor.purpleColor(), range: NSMakeRange(7, 15))
    26         titleL.attributedText = attr
    27         
    28         self.view.addSubview(titleL)
    29         return titleL;
    30     }
  • 相关阅读:
    tp文件上传
    tp5与页面链接
    tp5语法查询
    tp5基本增删改查
    tp5基本登录
    数据修改
    文件上传。判断。一维二维数组
    数据库连接
    php针对于数据库的改变
    php数据库连接
  • 原文地址:https://www.cnblogs.com/guangleijia/p/5498319.html
Copyright © 2011-2022 走看看