开发者

UITableViewCell with UITableViewCellStyleValue1; how to get cell to resize textLabel to respect detailtext

开发者 https://www.devze.com 2023-04-08 00:12 出处:网络
UITableViewCellStyleValue1 is the cell style that has left-hand black text and right-hand blue detail text.

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.

0

精彩评论

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