获取UIView FXBlurView单独的类
我正在使用FXBlurView,但是当将blurViewanimation时,我在顶部接收到一个奇怪的黑线。
我有一个UITable
是3/4的ViewController和其余的图像。 发生了什么是在UITable
视图中只是拾取UITable
而不是图像。 那么有没有一种方法可以让superview
同时提取? 还是replace?
我已经读过,这可以通过用实际的UIViewreplace超级视图来解决
FXBlurView默认捕获其直接超级视图的内容。 如果超级视图是透明的或部分透明的,则其后面显示的内容将不被捕获。 如果需要,您可以覆盖
underlyingView
属性以捕获不同视图的内容。
FXBlurView.m
代码是:
- (UIView *)underlyingView { return _underlyingView ?: self.superview; }
我试过这个:
((FXBlurView *)self.Genres).underlyingView = _main_view;
但这没有什么区别
其中ImagesTableViewController
是我的主要ViewController
包含Blured Uiview和我想复制( main_view
)
但是这只是为Blured Uiview创build了一个白页。
首先你不需要编辑FXBlurView源代码。
其次,我猜黑条是未被拾取的视图层次结构的一部分。 也许是一个导航栏? 您可以尝试将模糊视图添加到窗口而不是视图,以便抓取所有内容:
[[[UIApplication sharedApplication] keyWindow] addSubview: blurView];
如果没有,我能想到的唯一的黑客就是做一个imageView使用窗口抓住它的形象:
- (UIImage *)screenGrab:(id) theView { CGRect rect = [self.view bounds]; UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(); [theView.layer renderInContext:context]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return image; }
有:
[self screenGrab: [[UIApplication sharedApplication] keyWindow]];
然后将imageView.image设置为抓取的图像,并将其设置为底层视图。 你不应该需要这样做:)
否则,我需要看到更多的代码来理解视图层次结构。