图像不在UIImageView中

时间:2012-04-07 14:21:42

标签: ios cocoa uiimageview

我使用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;

0 个答案:

没有答案