I have 2 UILabels for a scorekeeping app (Home and Away). The user can tap on Home or Away and change the label to be whatever they like. This is all working fine. When a user enters a name larger than the label size it will shrink the font to fit. This makes the 2 labels no longer match in font size, and doesn’t look right. My question: How can you set the font size of one label to the size of another label that has been “autoshrunk”?
I also realize I will need to write code to determine which font size is smaller between the two labels and set them both to that number. I don’t think I will have a problem with that, as long as I get an answer to the above question. It seems like it should be simple, but it has so far eluded me.
So I hope you know the frame size of both the labels.
Use – sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode: to find the minimum font size that it would use.
If you have any doubt, please let me know.