所选图像不会加载到ios 7中的自我图像查看器中

时间:2013-10-09 11:26:13

标签: iphone ios uiimageview ios7

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

但是当我安装ios 7并运行我的应用程序时出现错误。它无法加载点击的图像。 当用户单击第5行图像时,图像查看器从20开始加载第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还是其他什么?

2 个答案:

答案 0 :(得分: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];
    }

}

}

答案 1 :(得分:0)

在viewwillappear方法的EGOphotoviewcontroller中

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

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

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