Question about varrying top margin when using custom Fonts on the iPhone.

Posted by user170030 on Stack Overflow See other posts from Stack Overflow or by user170030
Published on 2010-05-11T12:35:07Z Indexed on 2010/05/11 13:44 UTC
Read the original article Hit count: 227

Filed under:
|
|
|
|

I am using FontLabel to display varying lengths of texts in a custom font. I size the FontLabel using the following :

CGSize size = [myString sizeWithFont:[UIFont systemFontOfSize:[[[UIApplication sharedApplication] delegate] getFontSize]]
         constrainedToSize:CGSizeMake(290, 4000)
          lineBreakMode:UILineBreakModeWordWrap];

For some reason, this always presents a Fontlabel where the text starts at a different space from the top. Sometimes the text begins at the correct location. Other times, it appears either too high or too low.

Would appreciate some help in how to solve this issue.

© Stack Overflow or respective owner

Related posts about iphone-sdk

Related posts about iphone