Open iStarEternal opened 8 years ago
If you want to Demo, ask me.
I think the problem is that FXBlurView hides subviews automatically when snapshotting, then re-shows them. I guess it should kee track of which ones were already hidden.
Thank you for your kind reply. I hope you can make it better soon.
I have same problem. I agree that this is a serious bug.
@nicklockwood I found this bug.
- (NSArray *)hideEmptyLayers:(CALayer *)layer
{
NSMutableArray *layers = [NSMutableArray array];
if (CGRectIsEmpty(layer.bounds)) // **** Bug is here. ****
{
layer.hidden = YES;
[layers addObject:layer];
}
for (CALayer *sublayer in layer.sublayers)
{
[layers addObjectsFromArray:[self hideEmptyLayers:sublayer]];
}
return layers;
}
This line should check if the layer is already hidden:
if (CGRectIsEmpty(layer.bounds))
change to this will resolve problem:
if (CGRectIsEmpty(layer.bounds) && !layer.hidden)
Can I create a PR for this?
@HoneyLuka sounds a good approach, they use all layers with bounds even the hidden layers in order to render the view. After rendering, they restore the superview unhiding all layers. (even your hidden layers).
FXBlurView has a serious Bug. When I set subview hidden:
view.subviews[1].hidden = true;
And add FXBlurView:[view addSubview:[[FXBlurView alloc] initWithFrame:view.bounds];
The subview.hidden will become false.Example:
I'm using MJRefresh: https://github.com/CoderMJLee/MJRefresh
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(refreshHeader:)];
header.lastUpdatedTimeLabel.hidden = true;
self.tableView.mj_header = header;
Now, all is all right! But when I add it:
FXBlurView *blurView = [[FXBlurView] alloc] initWithFrame:self.view.bounds];
[self.view addSubview:blurView];
And The I remove it.[blurView removeFromSuperView];
self.tableView.mj_header.lastUpdatedTimeLabel.hidden was became false.I find the was unusual when
for (CALayer *layer in superlayer.sublayers) { layer.hidden = false; }
There!
Please forgive me for being impolite, My English is not very good.