tmp
Monday, October 26, 2015
NSAttributedString いろいろ
###text color ```swift let attributes = [ NSForegroundColorAttributeName: UIColor.redColor() // 文字色指定 ] let attributedString = NSAttributedString(string: "foo", attributes: attributes) ``` ###text shadow ```swift let shadow = NSShadow() shadow.shadowColor = UIColor.blackColor() // 影の色指定 shadow.shadowBlurRadius = 4 // 影のぼかし半径 shadow.shadowOffset = CGSizeMake(2, 2) // 影の位置 let attributes = [ NSShadowAttributeName: shadow ] let attributedString = NSAttributedString(string: "foo", attributes: attributes) ``` ###line space ```swift let style = NSMutableParagraphStyle() style.lineSpacing = 7 let attributes = [ NSParagraphStyleAttributeName: style ] let attributedString = NSAttributedString(string: "foo", attributes: attributes) ```
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment