UITableViewCell Display multiple fonts

后端 未结 4 2037
天命终不由人
天命终不由人 2021-01-28 13:50

I want to display two words in the uitableviewcell in different fonts similar to the iPhone Address Book. Ex: John Buchanan

4条回答
  •  北荒
    北荒 (楼主)
    2021-01-28 14:44

    Either you should use two UILables, or you can use OHAttributedLabel to draw NSAttributedString..

    EDIT:

    You can change the UILabel size dynamically using,

    CGSize expectedLabelSize = [titleLabel.text sizeWithFont:titleLabel.font]; 
    titleLabel.frame = CGRectMake(xBase, yBase, expectedLabelSize.width, expectedLabelSize.height);
    

提交回复
热议问题