UITableViewCell with UITableViewCellStyleValue1; how to get cell to resize textLabel to respect detailtext
UITableViewCellStyleValue1 is the cell style that has left-hand black text and right-hand blue detail text.
I开发者_开发百科 can set adjustsFontSizeToFitWidth to ensure that the textLabel respects the width of the cell, but it may still over-display the detailTextLabel. How can I tell the textLabel to adjust it's size for to respect the detailView? Is sub-classing UITableViewCell the only approach?
Yes, the only way that I would tackle this problem is via a subclass. You could do it with what you are given, but you are in the end, you are putting the same amount of work into it, so I would go with the more control you get with a subclass, so if you wanted to change anything in the future you have the power to do so.
精彩评论