简体   繁体   English

NIToolBarPhotoViewController可显示所选图像中的图像

[英]NIToolBarPhotoViewController to display images from a selected image

I am using Nimbus to display photos. 我正在使用Nimbus显示照片。 I have a tableviewcontroller displaying list of filenames. 我有一个tableviewcontroller显示文件名列表。 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. 当用户选择特定文件(如果是图像)时,它将在NIControllerBarPhotoViewController扩展的viewcontroller中显示所有图像文件,从我的照片源数组的第一个元素(即photoFiles)开始,这是列表中的第一个元素。

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: 但是,我无法从特定索引启动photoview作为方法:

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

gets called directly as per the example NetworkPhotoAlbumViewController. 按照示例NetworkPhotoAlbumViewController直接调用。 How can I get it to take the particular index before launch the photoview? 在启动photoview之前如何获取特定索引?

in viewDidLoad add this line 在viewDidLoad中添加此行

[self.photoAlbumView setCenterPageIndex:photoIndex];    

to set index of displayed photo 设置显示照片的索引

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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