Programtically setting properties of a UITextView iOS

Jump to: navigation, search

To dynamically set UITextView properties, such as font and color. you need to set the UITextView to editable first before modifying properties. Perhaps this is an SDK limitation that will be removed in the future. example: self.myUITextView.editable = YES; self.myUITextView.textColor = [UIColor whiteColor]; self.myUITextView.font = [UIFont systemFontOfSize:16]; self.myUITextView.text = @"Line1 \n Line2"; self.myUITextView.editable = NO; The example above shows how to insert a new line. Note the newline char would be render incorrectly as a string if you entered it in the Storyboard.

See also

Use your Android as a Genie garage door opener remote

Personal tools
Namespaces
Variants
Views
Actions
Navigation