views:

283

answers:

2

I am having some trouble getting my application to properly resize the text of UILabels when the user does a swipe to delete or other type of delete. Currently, the delete button is covering up the text that is in the cell (if it is really long). I would like for them to operate like how SMS (move clipped text down a line) or iPod (delete button resizing text).

I am using a custom UITableViewCell I am working with two labels, UIImageView and a couple of subviews for backgroundView and selectedBackgroundView. I have been playing with the springs and struts of the labels in the cell and partially attained my desired effect however, the text has a weird, quick resizing bug where it becomes deformed and stretched out and then is returned proper size when the delete button is done animating.

As far as other things that I have tried, I have made sure that my text does not adjust-to-fit and I have made my minimum font size the font size that I set for the label. I have also tried over-riding layoutSubviews but that didn't seem to have any effect at all.

If a screenshot (of the deforming label) or code would be helpful, I can post both but since nothing I have done is working, I figured they would be of little value.

A: 

It sounds like you need to set the number of lines property and the wrap property for the labels.

If your actively changing the size of the label itself, you might want to animate that change.

TechZen
What about give me the ellipsis effect as in the iPod app instead the wrapping in the SMS app? I wouldn't want to necessarily wrap the lines in that instance.
davidstites
In interface builder set the "line break" property to "truncate middle".
TechZen
fixed it by setting the "mode" of the label in the view panel to "left"
davidstites
Okay, I don't think I understood your problem then.
TechZen
+2  A: 

fixed it by setting the "mode" of the label in the view panel to "left"

davidstites
Thanks. I had the same problem.
Steve