我正在使用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