Reputation: 1497
I use this code to make my UITableViewCell
s
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentifier] autorelease];
If you're unfamiliar with UITableViewCellStyleValue2, the main text is shown, and then the detail text is shown after it, generally in a different color. However, when I do this, my main text is truncated, if it is longer than a short word. I want to force it to not truncate the main text and show the entire main text, and then the detail text after it. How can I do that?
Upvotes: 1
Views: 1402
Reputation: 113757
This isn't exactly what you want, but you can make the text in the main label re-size as it gets longer. Set the minimumFontSize
property on the UILabel
for the main text. That way if the text is too long, it will shrink the font until the minimum size before truncating it. If you need something more complicated, you'll probably have to make your own uiTableViewCell
subclass and lay out your own labels with text sizes.
Upvotes: 0
Reputation: 21882
You'll have to subclass UITableViewCell. You will need to override the layoutSubviews
method to adjust the text label frames as needed. I'm not sure if you will be able to do this using the standard textLabel
and detailTextLabel
properties -- you might have to create your own text labels instead of using those properties.
Upvotes: 2