0

我正在使用 EGOPhotoViewer 从 s3 加载一堆图像。它们首先在表格视图中显示在缩略图中,因此当用户单击第 5 行图像时,它会从 5 of 20 开始将图像加载到图像查看器中。这在 ios 6 中运行顺利。

但是当我安装 ios 7 并运行我的应用程序时,我得到了一个错误。它无法加载单击的图像。当用户单击第 5 行图像时,图像查看器会从 20 的第 1 个开始加载第 1 个图像。

我正在使用这么多代码。

  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath   *)indexPath

 {  ......


  [self showSelectedPhoto:indexPath];

 ......
}
  //load the selected image
  -(void)showSelectedPhoto:(NSIndexPath *)indexPath
{

 [UserInfo sharedInfo].Path=indexPath;
 NSLog(@"%@",indexPath);
 NSString *passingImageName=[[self.tableDataSource          objectAtIndex:indexPath.row]objectForKey:@"fileName"];
 NSMutableArray *photoArray=[self getFilteredArray];
 NSMutableArray *urlsArray=[[NSMutableArray alloc] init];

 //  [self.tableView reloadData];
  for (NSString *string in photoArray) {

     NSLog(@"String Values:%@",string);
     NSURL *imageUrl=[self getEnlargedImageImageUrl:[self._prefix stringByAppendingString:string]];
    NSLog(@"Passing url is:%@",imageUrl);
     photo = [[EGOQuickPhoto alloc] initWithImageURL:imageUrl name:string];

    [urlsArray addObject:photo];
}


self.source=[[EGOQuickPhotoSource alloc]initWithPhotos:urlsArray];

photoController = [[EGOPhotoViewController alloc] initWithPhotoSource:source];


[self.navigationController pushViewController:photoController animated:YES];
NSUInteger index = [photoArray indexOfObject:passingImageName];
 NSLog(@"index = %lu",(unsigned long)index);


[photoController moveToPhotoAtIndex:index animated:NO];
  }

所以它是 ios 7 ui bug 还是什么?

4

2 回答 2

4
 I got the solution of this,And it working fine For my app in IOS 7. 

              In EGOphotoviewer 


- (void)scrollViewDidScroll:(UIScrollView *)scrollView {

NSInteger _index = [self centerPhotoIndex];
if (_index >= [self.photoSource numberOfPhotos] || _index < 0) {
    return;
}

//Change here for IOS7...add "&&_index>0" after _rotating 
if (_pageIndex != _index && !_rotating && _index > 0) {

    [self setBarsHidden:NO animated:YES];
    _pageIndex = _index;
    [self setViewState];

    if (![scrollView isTracking]) {
        [self layoutScrollViewSubviews];
    }

}

}

于 2013-10-14T20:07:12.787 回答
0

在 EGOphotoviewcontroller 中 viewwillappear 方法

  if ([self.navigationController isToolbarHidden] && (!_popover || ([self.photoSource numberOfPhotos] > 1))) {
    [self.navigationController setToolbarHidden:NO animated:YES];
}

在 ios7 _pageindex 值为零后调用此方法后,我不知道实际原因,但我会给出一个想法。只需在此语句之后分配 _pageindex 值,例如 indexpath.row 或者可能是您要分配的标记值,

然后事情进展顺利... njoy...

于 2013-10-12T06:58:35.970 回答