画面よりもはるかに高い UIScrollView 内に UIView があります。私のコードは次のようになります
UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, -500.0f, 320.0f, 2000.0f)];
[_scrollView addSubview:contentView];
contentViewの画像をキャプチャしたい
//Screen capture.
UIGraphicsBeginImageContextWithOptions(contentView.frame.size, NULL, 0.0f);
[self.view drawViewHierarchyInRect:contentView.bounds afterScreenUpdates:NO];
UIImage* viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
上記のコードはシミュレーターでは機能しますが、実際のデバイス (iPod 第 5 世代) では機能しません。
contentView の代わりに scrollView をキャプチャすると問題なく動作しますが、画面に表示されているものだけがキャプチャされます。何か案は?