Gustavo Barbosa Gustavo Barbosa - 9 days ago 5
iOS Question

iOS UI best practice - UILabel or UITextView?

If you are creating an

UIView
for an iPhone application to display an article from a blog, for example.

What UI component would you recommend to display the article's body? An
UILabel
with
numberOfLines
equals to zero or an
UITextView
with no scrolling and fixed size?

Why?

Answer

This depends a bit on what exactly you're trying to do.

If you need to display static text with no editing features and no selection features, you should use a UILabel and place it in a UIScrollView if necessary.

If you need selection or editing, use UITextView.