How to format text in a UITableView?

In the iPhone Address Book app, the latest names / companies are shown in bold. I would like to do a little formatting of the text inside the cell.

I saw a few mentions about using UIWebView, but this seems like a very difficult decision. In addition, it is difficult, because you need to either fix the cell size or perform special processing to return the size.

Another option that I know is manually rendering the cell. This may not be too difficult for simple things, but it can obviously get very complicated very quickly.

Is there a simple way to get basic text formatting in a UITableView?

+3
source share
2 answers

- . , , . , UILabels , , , , , .

NSAttributedString UIKit iPhone, . -.

+1

, , :

  • ? textLabel detailLabel . .

  • (, "" )? , . UILabel, , , , , -[UITableViewCell drawRect:].

0

Source: https://habr.com/ru/post/1726762/


All Articles