2
我想創建一個藍色的矩形圖像,並看到它在我的觀點,但是這個代碼似乎並不工作:努力創造充滿藍色UIImage對象的矩形
CGRect imageRect = CGRectMake(50, 50, 64, 40);
UIGraphicsBeginImageContext(imageRect.size);
[[UIColor blueColor] set];
UIRectFill(imageRect);
UIImage *aImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageView *myImageView = [[UIImageView alloc] initWithImage:aImage];
[self.view addSubview:myImageView];
有人能解決它的我?
感謝,
Sagiftw
謝謝!我太容易了...... :) – Sagiftw 2010-07-26 05:35:27