0

RNBlurModalView ( https://github.com/rnystrom/RNBlurModalView ) を使用して、モーダル ビューの背景をぼかしています。問題は、テーブル ビューをスクロールすると、スクリーンショットもスクロールしないことです。スクロールすると、最終的にぼやけが消えます。テーブル ビューのコンテンツ オフセットを使用する必要があることはわかっていますが、それを既存のコードに実装する方法がわかりません。

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];

何か案は?

ありがとう。

4

1 に答える 1