开发者

Position of UILabel text in UITableViewCell

开发者 https://www.devze.com 2023-03-16 20:14 出处:网络
Let\'s say I have a UITableView cell which, by definition, has a textLabel associated with it. This textLabel surely has a frame which rea开发者_开发百科ches to the end of the UITableViewCell, by defa

Let's say I have a UITableView cell which, by definition, has a textLabel associated with it. This textLabel surely has a frame which rea开发者_开发百科ches to the end of the UITableViewCell, by default. Let's say that my textLabels on all my cells have different amounts of text. Some have one letter, some have three words.

I want to determine the pixel location of the last letter (or just the end of) a UITableViewCell's textLabel. Is this possible? I'm trying to draw a strike through line through the textLabel's text.


NSString has a method that returns the size given a UIFont, that size, plus the origin of the label should help your find that point you are looking for.

0

精彩评论

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