I have uploaded a custom font and applied this font on the title of a UIbutton using the following code
videoButton.titleLabel.font = [UIFont fontWithName:@"LaurenScript" size:20];
The problem is that the title is being clipped on the top of the first letter (see photo below). I tried the same font on the UIlabel and it works fine so it is not a problem with the font. I tried also to change the rectFrame using
[videoButton.titleLabel setFrame:CGRectMake(0, 0, 300, 600)];
but that didn't do anything. Has anybody a clue of how I can fix this problem? Cheers
I had a similar problem, where a diaeresis got cut off on top of the titlelabel. I made a UIButton subclass and used this code to fix the problem:
-(void)layoutSubviews { [super layoutSubviews]; CGRect frame = self.titleLabel.frame; frame.size.height = self.bounds.size.height; frame.origin.y = self.titleEdgeInsets.top; self.titleLabel.frame = frame; }
Select button in Interface builder and check for set a vertical alignment panel in the control section Below is example:
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