[英]How i can change font to UITextView in swift?
Hy們我希望我的textView
有這樣的字體: "Apple SD Gothic Light"
......我在這里使用的代碼屬於:
if (titolo.text == NSLocalizedString("SEVENTH_ANNOTATION_TITLE", comment: "")){
// aggiungo le immagini all'array
pageImages = [UIImage(named: "TeatroMassimoBellini1.png")!,
UIImage(named: "TeatroMassimoBellini2.png")!,
UIImage(named: "TeatroMassimoBellini3.png")!]
textFieldDescrizione.text = NSLocalizedString("SEVENTH_ANNOTATION_DESCRIPTION", comment: "")
textFieldDescrizione.font = UIFont.preferredFontForTextStyle("AppleSDGothicNeo-Light")
textFieldDescrizione.textAlignment = NSTextAlignment.Justified
}
但它不起作用....你能幫助我嗎? 對不起我的英語不好! :)
試試這個 :
textFieldDescrizione.font = UIFont(name: "NameOfTheFont", size: 20)
對於Swift 4,這對我有用
textView.font = UIFont(name: "Courier", size: 20)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.