Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 903
Gustavo Barbosa Avatar asked Aug 06 '13 01:08

Gustavo Barbosa


1 Answers

Update: As I commented below, I agree this is not the best answer these days. It was more accurate back in 2013, but today you should use a text view for a large text field. I cannot delete this, as it's the accepted answer, but I agree (and voted for) Vishnu's answer below.

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.

like image 166
garrettmurray Avatar answered Sep 19 '22 22:09

garrettmurray