thiagoperes / IDMPhotoBrowser

Photo Browser / Viewer inspired by Facebook's and Tweetbot's with ARC support, swipe-to-dismiss, image progress and more
MIT License
2.71k stars 642 forks source link

Can not play animation in a ModalViewController #74

Open JPlay opened 10 years ago

JPlay commented 10 years ago

1.create a viewController,and present it. ViewController *vc = [[ViewController alloc] init]; [self presentViewController:vc animated:YES completion:nil];

2.use IDMPhotoBrowser NSArray list = @[[UIImage imageNamed:@"photo1l.jpg"], [UIImage imageNamed:@"photo3l.jpg"], [UIImage imageNamed:@"photo2l.jpg"] ]; NSArray listPhoto = [IDMPhoto photosWithImages:list]; IDMPhotoBrowser *browser = [[IDMPhotoBrowser alloc] initWithPhotos:listPhoto animatedFromView:imageView]; [self presentViewController:browser animated:YES completion:nil];

3.now,when I drag the image,the background is always black.

db12f54a-32bf-48da-8057-068e85d5f3d6

sprint84 commented 10 years ago

+1 for this issue!

sprint84 commented 10 years ago

I can reproduce this issue, but I don't know how to fix it yet. I'm presuming there is an OS limitation around modal view controllers. When the second modal view controller is presented, the first one is probably being removed from view hierarchy.

pranavss11 commented 10 years ago

Anyone manage to fix this yet? I'm getting the same issue.

bawn commented 8 years ago

+1

bawn commented 8 years ago

@JPlay @pranavss11 @sprint84

Temporary solution, In IDMPhotoBrowser.m move [self performPresentAnimation]; function to - (void)viewWillAppear:(BOOL)animated

- (void)viewWillAppear:(BOOL)animated {
    // Update
    [self reloadData];

    // Super
    [super viewWillAppear:animated];

    // Status Bar
    _statusBarOriginallyHidden = [UIApplication sharedApplication].statusBarHidden;

    // Update UI
    [self hideControlsAfterDelay];

    [self performPresentAnimation];
}