Can you please let me know what is the best way to display a long text in the app? I would like to display text about the company. Now I do have tableView and inside of the cell just a normal UILabel. Is it ok? Thanks!
Asked
Active
Viewed 733 times
1
-
How long is long? How many characters does your text contain? – dr_barto Jan 24 '18 at 19:28
-
My favorite for those things is a TextView. Scrollable and just plain or attributed text. Always use this for info sections or protocols. – Aeger Jan 24 '18 at 19:28
-
you might find this question interesting for your task: https://stackoverflow.com/q/48423558/2912282 – Milan Nosáľ Jan 24 '18 at 19:35
1 Answers
2
Yes, its ok to display long text in the UILabel. In Label you can also use attributed string in case you need anytime. You need to make sure dynamic height of the table row with the UILabel content. Use 0 as number of lines for the UILabel and TextWrap as the Line break option. Make sure you have good constraints for your label in the cell row.

Ash
- 5,525
- 1
- 40
- 34
-
-
Yes, You can put Height constraint with equalTo..... on the label's height,.. but watch it carefully in different devices and make sure it won't truncate your text for bigger text... – Ash Jan 24 '18 at 22:22