0

UIView (サブビューを UIImageViews として) をプログラムで UIImage に変換するにはどうすればよいですか?

これは一般的な方法ですか?

4

2 に答える 2

7

特定のビューの「スクリーンショット」が必要なようですか?

UIGraphicsBeginImageContext(view.bounds.size); 
CGContextRef ctx = UIGraphicsGetCurrentContext();
[view.layer renderInContext:ctx];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
于 2013-03-10T16:50:02.257 に答える