当我拍摄滚动视图的屏幕截图时,UISegmentedControl中所选片段的标题会消失

时间:2014-11-06 14:53:30

标签: ios scrollview screenshot title

这是我的代码,用于截取我的scrollview的截图:

UIImage* image = nil;
UIGraphicsBeginImageContextWithOptions(_scrollView.contentSize, _scrollView.opaque, 0.0);
        {
            CGPoint savedContentOffset = _scrollView.contentOffset;
            CGRect savedFrame = _scrollView.frame;
            _scrollView.contentOffset = CGPointZero;
            _scrollView.frame = CGRectMake(0, 0, _scrollView.contentSize.width, _scrollView.contentSize.height);

            [_scrollView.layer renderInContext: UIGraphicsGetCurrentContext()];
         }

我试过这个没有成功:

[_scrollView drawViewHierarchyInRect:_scrollView.bounds afterScreenUpdates:YES];

0 个答案:

没有答案