我正在使用RNBlurModalView(https://github.com/rnystrom/RNBlurModalView)模糊我的模态视图的背景。问题是,当我滚动我的表格视图时,屏幕截图也不会滚动。滚动时,模糊最终消失。我知道我需要使用内容表视图的偏移,但我不知道如何实现它在现有的代码ios tableview +屏幕截图
RNBlurModalView.m
#pragma mark - UIView + Screenshot
@implementation UIView (Screenshot)
- (UIImage*)screenshot {
UIGraphicsBeginImageContext(self.bounds.size);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
// hack, helps w/ our colors when blurring
NSData *imageData = UIImageJPEGRepresentation(image, 1); // convert to jpeg
image = [UIImage imageWithData:imageData];
return image;
}
@end
而我实现了视图
- (IBAction)locationPressed:(id)sender {
UIStoryboard *storyBoard = [self storyboard];
HomeViewController *homeView = [storyBoard instantiateViewControllerWithIdentifier:@"HomeViewController"];
RNBlurModalView *modal = [[RNBlurModalView alloc] initWithViewController:self title:@"Hello world!" message:@"Pur your message here."];
[modal show];
[self presentPopupViewController:homeView animationType:MJPopupViewAnimationSlideBottomBottom];
任何想法的代码?
谢谢。
你能提供代码,你介绍模糊视图?我认为问题在于你将它添加到UITableView,所以它作为标题。 – Emanuel
编辑了该问题以向您提供该代码 – jacobt