0
A
回答
0
let attributedString = NSAttributedString(string: "YourTitle", attributes: [
NSFontAttributeName : UIFont.systemFontOfSize(18), //your font here
NSForegroundColorAttributeName : UIColor.black()
])
let alert = UIAlertController(title: "TextTitle", message: "YourMessage", preferredStyle: .Alert)
alert.setValue(attributedString, forKey: "attributedTitle")
let cancelAction = UIAlertAction(title: "Cancel",
style: .Default) { (action: UIAlertAction!) -> Void in
}
presentViewController(alert,
animated: true,
completion: nil)
0
可以使用SweetAlert
SweetAlert().showAlert("Here's a message!", subTitle: "It's pretty, isn't it?", style: AlertStyle.None)
相關問題
- 1. C-style for swift 2
- 2. ionic 3 alert font-sizing
- 3. 在iPad上展示UIAlertController(alert style)是否安全無彈窗?
- 4. Swift 3 Geofencing問題
- 5. 當前視圖:Swift 3
- 6. Youtube Style Swift中的Navbar導航
- 7. 呼叫從SWIFT 3
- 8. selectedindex in Alert after Alert
- 9. Bootstrap 3 Grid Style問題與對齊
- 10. Swift 3 Swift 4 kishikawakatsumi/SpreadsheetView
- 11. Swift FBSDKLogin Swift 3 AppDelegate更新
- 12. 代表無(Swift 3)
- 13. swift3從其他swift中調用alert函數。文件
- 14. Swift 3 Array Restrictions
- 15. UILongPressGestureRecognizer in Swift 3
- 16. Swift 3 - Hide Elements
- 17. Swift 3 - CFHostScheduleWithRunLoop crash
- 18. rindex in Swift 3
- 19. canBecomeFocus on swift 3
- 20. Swift 3 sqlite bug
- 21. SWIFT 3與MySQL
- 22. SWIFT 3 - MTLResourceOptions.cpuCacheModeDefaultCache
- 23. Swift 3:stringByReplacingCharactersInRange alternatives
- 24. Swift 3 subclassing OperationQueue
- 25. iOS Swift 3 - UIDatePicker
- 26. Swift 3緩存
- 27. Swift 3 references
- 28. NSFastEnumerationIteration.member Swift 3
- 29. Asynchronous swift 3
- 30. ALAssetsLibraryGroupsEnumerationResultsBlock in swift 3