我使用UIImageView
向我的应用程序添加了IBOutlet
,然后以编程方式分配了图像,但图像未显示。我的代码如下所示:
NSString *string = @"Some text";
UIGraphicsBeginImageContext(CGSizeMake(180, 50));
[string drawAtPoint:CGPointMake(10, 20)
withFont:[UIFont systemFontOfSize:12]];
UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//[imageview setImage:result];
//[imageview
sample.image =result;