首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MWPhotoBrowser不会显示照片

MWPhotoBrowser不会显示照片
EN

Stack Overflow用户
提问于 2013-11-06 01:28:46
回答 2查看 1.2K关注 0票数 1

我正试图在我的项目中实现MWPhotoBrowser。我增加了所有的代表,但仍然不显示照片。

这是我的didSelectRowAtIndexPath:

代码语言:javascript
复制
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
  [self performSegueWithIdentifier:@"MWPhotoBrowserSegue" sender:self] 
}

这是我的方法:

代码语言:javascript
复制
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
   if ([segue identifier] isEqualToString:@"MWPhotoBorwserSegue"]) 
   {
       photoBrowser = [[MWPhotoBrowser alloc]initWithDelegate:self]; 
       UINavigationController * nc = [[UINavigationController alloc]initWithRootViewController:photoBrowser]; 

      nc.modalTransitionStyle = UIModalTransitionStyleCrossDisolve; 

      [photos addObject:[MWPhoto photoWithImage:[UIImage imageNamed:@"picasa.jpg"]]; 

      [photoBrowser setCurrentPhotoIndex:0]; 

      [self.navigationController presentViewController:nc animated:YES completion:nil]; 
   }
}

#ofPhotosInBrowser:

代码语言:javascript
复制
-(NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser 
{
    return self.photos.count;
}

photoAtIndex:

代码语言:javascript
复制
- (MWPhoto *)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index {
if (index < self.photos.count)
    return [self.photos objectAtIndex:index];
return nil;
}

下面是我在didSelectRowAtIndexPath之后得到的信息:叫做:

解决方案编辑:

MWPhotoBrowser将不会显示照片,除非您将self.title放在initWithStyle:方法中。我还忘了添加viewWillDisappear和viewWillAppear

EN

回答 2

Stack Overflow用户

发布于 2013-12-22 08:57:43

我认为你需要调用它的重新加载数据。检查一下Mwphotobrowser.h是否有正确的方法。

票数 0
EN

Stack Overflow用户

发布于 2015-01-15 05:01:22

尝试此[NSOperationQueue mainQueue addOperationWithBlock:^{ self mainQueue动画:YES mainQueue:nil;}];

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19802408

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档