gpt4 book ai didi

iphone - EGO照片查看器 : Start at specific photo

转载 作者:行者123 更新时间:2023-11-28 18:44:31 25 4
gpt4 key购买 nike

我正在使用 EGOPhotoViewer 从网络上加载一堆图像。它们首先以缩略图显示,因此当用户单击其中一个缩略图时,我想首先在 EGOPhotoViewer 中显示该图像。因此,如果我点击第 5 张图片,它会从 20 张中的第 5 张开始加载图片查看器。

有办法吗?

ZSPhoto *photo;

for (Asset *a in items) {
photo = [[ZSPhoto alloc] initWithImageURL:[NSURL URLWithString:a.imgURL] name:a.caption];
[photos addObject:photo];
[photo release];
}

// Photosource
ZSPhotoSource *photoSource = [[ZSPhotoSource alloc] initWithPhotos:[NSArray arrayWithArray:photos]];
EGOPhotoViewController *photoController = [[EGOPhotoViewController alloc] initWithPhotoSource:photoSource];

// Set starting photo index here?

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:photoController];
navController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
navController.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController:navController animated:YES];
[navController release];
[photoController release];

最佳答案

我遇到了同样的问题,我正在做的是尝试 moveToPhotoAtIndex: 在将它推送到 navigationController 之前。你需要在之后做。

这是我如何让它为我的应用程序工作...

//从tableView获取indexPath

-(void)showSelectedPhoto:(NSIndexPath *)indexPath{

// Already had photoControllerView declared in header, init with your photo source
photoControllerView = [[EGOPhotoViewController alloc] initWithPhotoSource:source];

// pushed the photoControllerView to the navigation controller
[self.navigationController pushViewController:photoController animated:YES];

// THEN you moveToPhotoAtIndex and it should work correctly!
[photoController moveToPhotoAtIndex:indexPath.row animated:NO];
}

希望这有助于澄清事情!

关于iphone - EGO照片查看器 : Start at specific photo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6461938/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com