iphoneiosuitableviewtextlabel

How to limit width of textLabel in UITabelViewCell


I want to restrict the width of textLabel of UITabelViewCell as it contains a image on its right side.

I don't want to use UILabel or subclass UITabelViewCell.


Solution

  • Try using the accessoryView property for the image on the right. This should prevent the label from getting too wide and truncating the text.

    [cell setAccessoryView:<your image view>];