MHVideoPhotoGallery icon indicating copy to clipboard operation
MHVideoPhotoGallery copied to clipboard

dismiss animation works only when pressing done button

Open ale84 opened this issue 9 years ago • 8 comments

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;

ale84 avatar Apr 28 '15 10:04 ale84

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

mariohahn avatar Apr 28 '15 10:04 mariohahn

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

ale84 avatar Apr 28 '15 10:04 ale84

I have seen that you are using version v1.6.6

Try using the newest one: v1.6.7

mariohahn avatar Apr 28 '15 11:04 mariohahn

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

mariohahn avatar Apr 28 '15 11:04 mariohahn

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.

ale84 avatar Apr 28 '15 12:04 ale84

I'm also facing this issue xCode 7.1.1 iOs 9.1

Nikita2k avatar Jan 18 '16 19:01 Nikita2k

@ale84 have you solved this?

Nikita2k avatar Jan 19 '16 20:01 Nikita2k

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.

ale84 avatar Jan 20 '16 11:01 ale84