我正在制作 Android 应用程序的 iOS 版本。我想让我正在通过的字符串变成粗体。在另一个应用程序中,它是通过添加 html 来完成的,如下所示。我尝试了这个,但没有成功。有没有办法实现这个或可能解决这个问题?
旁注:showPrompt 是我为 UIAlertController 功能所做的开关。
谢谢,
func systemUpdateCheck(oCurVer: String){
showPrompt("A new version has been released,<b>v." + oCurVer + "<b>.<br/>Tap OK to download and install the new version", sType: "alert", sJSResp: "")
}
Run Code Online (Sandbox Code Playgroud)
小智 6
尝试这个
Run Code Online (Sandbox Code Playgroud)let attributedText = NSMutableAttributedString(string: "Message", attributes: [NSAttributedStringKey.font: UIFont(name:".SFUIText-BoldItalic", size: 12)!]) let alert = UIAlertController(title: "Title", message: "", preferredStyle: .alert) alert.setValue(attributedText, forKey: "attributedMessage") let okAction = UIAlertAction(title: LocalizedString("Ok"), style: .default) alert.addAction(okAction) present(alert, animated: true)
| 归档时间: |
|
| 查看次数: |
4550 次 |
| 最近记录: |