相关疑难解决方法(0)

UIAlertcontroller设置了归属消息

我们如何在UIAlertcontroller中将归属文本设置为消息.我的尝试代码如下,但它会崩溃的应用程序.

// create Attributed text

let myAttribute = [NSForegroundColorAttributeName: UIColor(red:122.0/255, green:125.0/255, blue:131.0/255, alpha:1.0),NSFontAttributeName: Constant.flinntRegularFont(15)]
let myAttribute2 = [NSForegroundColorAttributeName: UIColor.blackColor(),NSFontAttributeName: Constant.flinntMediumFont(15)]

let myString = NSMutableAttributedString(string: "You have been unsubscribed from ", attributes: myAttribute)
let myString2 = NSMutableAttributedString(string: self.course.course_name, attributes: myAttribute2)
let myString3 = NSMutableAttributedString(string: "\n\nYour refund will be initiated within one week.", attributes: myAttribute)
let myString4 = NSMutableAttributedString(string: "\n\nFor any help call us on", attributes: myAttribute)
let myString5 = NSMutableAttributedString(string: " 079-4014 9800", attributes: myAttribute2)
let myString6 = NSMutableAttributedString(string: " between …
Run Code Online (Sandbox Code Playgroud)

iphone ios swift swift2.3

12
推荐指数
1
解决办法
8775
查看次数

标签 统计

ios ×1

iphone ×1

swift ×1

swift2.3 ×1