mariohahn / MHVideoPhotoGallery

A Photo and Video Gallery
MIT License
1.96k stars 352 forks source link

dismiss animation works only when pressing done button #94

Open ale84 opened 9 years ago

ale84 commented 9 years ago

I made an example project that uses MHVideoPhotoGallery, but the dismiss animation doesn't work. The image doesn't animate, instead it just disappear when you let go the finger, but when I click the Done button the animation works as expected.

See this example video: https://dl.dropboxusercontent.com/u/3947595/prova_mh.mov

This is the code I used to present the image:

 MHGalleryItem *landschaft1 = [[MHGalleryItem alloc]initWithURL:@"http://de.flash-screen.com/free-wallpaper/bezaubernde-landschaftsabbildung-hd/hd-bezaubernde-landschaftsder-tapete,1920x1200,56420.jpg"
                                                       galleryType:MHGalleryTypeImage];

    MHGalleryItem *landschaft2 = [[MHGalleryItem alloc]initWithURL:@"http://de.flash-screen.com/free-wallpaper/bezaubernde-landschaftsabbildung-hd/hd-bezaubernde-landschaftsder-tapete,1920x1200,56420.jpg"
                                                       galleryType:MHGalleryTypeImage];
    __weak ViewController *blockSelf = self;

    self.iv.presenter.interactive = YES;

    [self.iv setInseractiveGalleryPresentionWithItems:@[landschaft1, landschaft2] currentImageIndex:0 currentViewController:self finishCallback:^(NSInteger currentIndex,UIImage *image,MHTransitionDismissMHGallery *interactiveTransition,MHGalleryViewMode viewMode) {
        if (viewMode == MHGalleryViewModeOverView) {
            [blockSelf dismissViewControllerAnimated:YES completion:nil];
        }else{
            blockSelf.iv.image = image;
            blockSelf.iv.currentImageIndex = currentIndex;
            [blockSelf.presentedViewController dismissViewControllerAnimated:YES dismissImageView:blockSelf.iv completion:nil];
        }
    }];

    [self.iv sd_setImageWithURL:[NSURL URLWithString:landschaft1.URLString]];
    [self.iv setUserInteractionEnabled:YES];

    self.iv.shoudlUsePanGestureReconizer = YES;
mariohahn commented 9 years ago

Can you share your Example Code? xCode version? iOS Version?

ale84 commented 9 years ago

I'm using Xcode 6.2, and running the example on an iPhone 5c, iOS 8.1.1

Here you can find the example project: https://dl.dropboxusercontent.com/u/3947595/ProvaMH.zip

mariohahn commented 9 years ago

I have seen that you are using version v1.6.6

Try using the newest one: v1.6.7

mariohahn commented 9 years ago

hmm... I can't see any Issues if i run the Example Code for both Versions..

ale84 commented 9 years ago

I tried to use v1.6.7, but the animation is still not working. I also updated Xcode to version 6.3 and installed the example on an iPhone 6 with iOS 8.3, but the result is the same. Also, if I run the Example within the library, everything is fine. I don't know what it could be.

Nikita2k commented 8 years ago

I'm also facing this issue xCode 7.1.1 iOs 9.1

Nikita2k commented 8 years ago

@ale84 have you solved this?

ale84 commented 8 years ago

I think the problem is related to the contentMode of the imageView from which the gallery is presented. Setting the contentMode from ScaleToFill to AspectFill solved the problem in my example project.