xcode - Why sizeWithFont: and sizeWithAttributes: return different values? -
i have cclabelttf nsstring text. on 5th ios sizewithfont: returns height bigger sizewithattributes: on 7th.
if ([[[uidevice currentdevice] systemversion] compare:@"7.0" options:nsnumericsearch] == nsorderedascending) { dim = [string sizewithfont:font]; } else { dim = [string sizewithattributes:[nsdictionary dictionarywithobject:[uifont fontwithname:name size:(cgfloat)size] forkey:nsfontattributename]]; } dim differs on 1 pixel 5 , 7 ios
Comments
Post a Comment