iphone UITableViewCellStyleValue1 detailTextLabel overlapping textLabel
I'm using UITableViewCellStyleValue1 in my table and setting some text for both the textLabel and detailTextLabel. In one cell the detail text label is a long URL, which overlaps with the textLabel (normally "URL" and then shortened to "U."), which sucks. Is there a way to prevent this, except from creating my own label and putting it at the same spot where the default one is?
开发者_StackOverflow社区Thanks!
You need to set the minimum font size for the TextLabel. UILabel Class Reference
adjustsFontSizeToFitWidth
A Boolean value indicating whether the font size should be reduced in order to fit the title string into the label’s bounding rectangle.
@property(nonatomic) BOOL adjustsFontSizeToFitWidth
Discussion
Normally, the label text is drawn with the font you specify in the font property. If this property is set to YES, however, and the text in the text property exceeds the label’s bounding rectangle, the receiver starts reducing the font size until the string fits or the minimum font size is reached.
The default value for this property is NO. If you change it to YES, you should also set an appropriate minimum font size by modifying the minimumFontSize property. Availability
* Available in iPhone OS 2.0 and later.
See Also
* @property font * @property minimumFontSize
精彩评论