I am using iOS 7`s new Dynamic Text feature for the subtitle of a table view row. I have set the UILabel in IB as follows:
This is how I set the contents of the UILabel in code:
NSAttributedString *checkmarkAttributedString = [[NSAttributedString
alloc]initWithString:@"☑"];
[detailAttributedString appendAttributedString:checkmarkAttributedString];
This is the result which is not autoshrinked correctly (the font size should be scaled down and the "..." avoided):
How can I get autoshrink to work?
It seems that it works correctly when I do not add the special character (checkmark) at the beginning of the string.
Not sure but it looks like the Minimum Font Scale has a comma in it. Shouldn't it be 0.4?
Otherwise try this in your cellForRowAtIndexPath method.
MyCustomTableViewCell *cell = [tableview dequeueReusableCellWithIdentifier:identifier];
cell.detailLabel.adjustsFontSizeToFitWidth = YES;