I noticed in my iOS app, for text that are using a system font with size 20 pt or more, the bottom of text is being cut off.
For example, the bottom portion of the letters y, g, p, and g are being cut off.
How do I fix this in Xcode?
If your using something like a UILabel it means you will need to increase the vertical height of that element.. Either in code or in interface builder.
If you are doing it in code you can get the label to resize itself to fit the contents by calling sizeToFit..
[myLabel sizeToFit];
Alternatively you could measure the size to the string by using sizeWithAttributes:
then change the size of the label accordingly.
Updating this one for Swift 3.x in a UITableViewController
.
In cellForRowAtIndexPath
after the problematic label is set, but before the cell is returned from the method, add a line something like this:
cell.myLabelWhoseCharactersLikegyqGetCutOff.sizeToFit()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With