3
le caractère Newline ne fonctionne pas dans draw rect de UIView? quelqu'un peut-il aider?Pourquoi le caractère de retour à la ligne ne fonctionne pas lorsque je dessine une chaîne dans -drawRect :?
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
UIFont * f = [UIFont systemFontOfSize:20];
[[UIColor darkGrayColor] set];
CGRect b = [self bounds];
NSString * text = @"hi \nr u";
CGSize sz = CGSizeMake(150,200);
CGContextScaleCTM(context, b.size.width/sz.width, b.size.height/sz.height);
[text drawAtPoint:CGPointMake(0,0) withFont:f];
}