开发者

How can I format text in UITableViewCell?

开发者 https://www.devze.com 2022-12-10 13:55 出处:网络
I\'d like to format text in my application\'s UITableView, like App开发者_开发技巧le did in the iPhone\'s Contact application.

I'd like to format text in my application's UITableView, like App开发者_开发技巧le did in the iPhone's Contact application.

Basically last name is bold, and first name is not.

Is there a clean and simple way of accomplishing this?


Add separate UILabels to your cell's contentView, and format the text in each one of them accordingly.


You could add a subclassed UIView to your cell, or just use the subclassed cell, and in drawRect, go ahead and draw your text with all the formatting you require. Again, you will have to calculate where the first and last name go in relation to each other.

0

精彩评论

暂无评论...
验证码 换一张
取 消