Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

uitextview text alignment

Swift 5:
let textView = UITextView(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
let style = NSMutableParagraphStyle()
style.alignment = .center
let text = NSAttributedString(string: yourtextcontentstring,
                              attributes: [NSParagraphStyleAttributeName:style])
textView.attributedText = text
 
PREVIOUS NEXT
Tagged: #uitextview #text #alignment
ADD COMMENT
Topic
Name
7+1 =