Istnieje wiele publicznych repozytoriów na temat gita, które prawdopodobnie mogą zrobić to, co chcesz. Niektóre rzeczy znalazłem:
https://github.com/mariohahn/MHVideoPhotoGallery
https://github.com/mwaterfall/MWPhotoBrowser
te mogą być zbyt skomplikowane. Inną opcją jest tworzenie UIImageView w tym samym miejscu co komórka, a następnie animowanie go w celu wypełnienia ekranu. Ten kod zakłada, że collectionView ma początek w (0,0), jeśli nie, po prostu dodaj przesunięcie collectionView podczas obliczania początkowej ramki.
collectionView.scrollEnabled = false; // disable scrolling so view won't move
CGPoint innerOffset = collectionView.contentOffset; // offset of content view due to scrolling
UICollectionViewLayoutAttributes *attributes = [collectionView layoutAttributesForItemAtIndexPath:[NSIndexPath indexPathForItem:index inSection:0] ];
CGRect cellRect = attributes.frame; // frame of cell in contentView
UIImageView *v = [[UIImageView alloc] initWithFrame:CGRectMake(cellRect.origin.x - innerOffset.x, cellRect.origin.y - innerOffset.y, cellRect.size.width, cellRect.size.height)];
[self.view addSubview:v]; // or add to whatever view you want
v.image = image; // set your image
v.contentMode = UIViewContentModeScaleAspectFit; // don't get stupid scaling
// animate
[UIView animateWithDuration:0.5 animations:^{
[v setFrame:[[UIScreen mainScreen] bounds]]; // assume filling the whole screen
}];
To nie jest ładna animacja popping, ale powinna wyglądać dobrze.
[To może pomóc] (https://github.com/mariohahn/MHVideoPhotoGallery). Ma wiele przykładów funkcjonalnych. Aby to zadziałało, musisz korzystać z klas przenoszenia i animacji. – Dima
[This] (http://stackoverflow.com/questions/12481004/how-to-animate-a-uiimageview-to-display-fullscreen-by-tapping-on-it) może odpowiedzieć na twoje pytanie –