I'm having a problem with NSString drawInRect method. I have a very large text to be painted over a 768x1024 size Rect and I obtain the attached image.
As you can see the only text line that reaches the whole screen is the last one, I don't know why other lines don't.
This is my code:
Code:
//The drawing rectangle
CGRect textRect = CGRectMake(1, 4, 768, 1024);
[[UIColor blackColor] set];
CGContextSetTextDrawingMode(context, kCGTextFillStroke);
//texto_completo is a very large text String
[texto_completo drawInRect:textRect withFont:font lineBreakMode:UILineBreakModeCharacterWrap alignment:UITextAlignmentLeft];
CGImageRef cgImage = CGBitmapContextCreateImage(context);
UIImage *img_con_texto = [[UIImage alloc] initWithCGImage:cgImage];
UIGraphicsPopContext();
CGContextRelease(context);
CGImageRelease(cgImage);
Any help why drawInRect does not write text until complete the width rect?
I´ve been many days with this and no solution found.