objective c - iOS 7.1 NSString drawInRect -
i have code worked fine until built project ios 7.1. before, text correctly showed on pdf page.
[strsometext drawinrect:rectfortext withattributes:[nsdictionary dictionarywithobjectsandkeys:font, nsfontattributename, mutparagraphstyle, nsparagraphstyleattributename, colorred, nsforegroundcolorattributename, nil]];
but now, in formatting dictionary being disregarded. pdf document shows black text of default font , size.
thank responses.
i try using nsattributedstring
, find whether works. not have reason why code has stopped working, try this:
// these variables examples, keep whatever variables using uifont *font = [uifont fontwithname:@"whatever_font" size:16.0f]; nsparagraphstyle *paragraphstyle = [nsparagraphstyle defaultparagraphstyle]; nsdictionary *attributes = @{nsfontattributename : font, nsparagraphstyleattributename : paragraphstyle, nsforegroundcolorattributename : [uicolor redcolor]}; nsattributedstring *attributedstring = [[nsattributedstring alloc] initwithstring:examplestring attributes:attributes]; [attributedstring drawinrect];
Comments
Post a Comment