简体   繁体   中英

NIToolBarPhotoViewController to display images from a selected image

I am using Nimbus to display photos. I have a tableviewcontroller displaying list of filenames. When the user select particular file (if an image) , it displays all the image files in viewcontroller extended from NIToolBarPhotoViewController starting fromt the first element of my photo source array ie photoFiles which is the first element in list.

I am returning the total count for scrollview pages like this:

- (NSInteger)numberOfPagesInPagingScrollView:(NIPhotoAlbumScrollView *)photoScrollView {
    return self.photoFiles.count;
}

However, I am unable to launch the photoview from a particular index as the method:

  - (UIImage *)photoAlbumScrollView: (NIPhotoAlbumScrollView *)photoAlbumScrollView
                     photoAtIndex: (NSInteger)photoIndex
                        photoSize: (NIPhotoScrollViewPhotoSize *)photoSize
                        isLoading: (BOOL *)isLoading
          originalPhotoDimensions: (CGSize *)originalPhotoDimensions

gets called directly as per the example NetworkPhotoAlbumViewController. How can I get it to take the particular index before launch the photoview?

in viewDidLoad add this line

[self.photoAlbumView setCenterPageIndex:photoIndex];    

to set index of displayed photo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM