我的应用程序中需要一个图库,我找到了有关如何在我的应用程序中实现 Three20 的教程:http://www.raywenderlich.com/1430/how-to-use-the-three20-photo-viewer .
我有一个 Storyboard ,其中根是标签栏 Controller 。这个根 Controller 与上面教程中的类 PhotoViewController 的 View Controller 有关系。
本教程的最后一步是将代码添加到 AppDelegate,但在我的例子中,我将此代码添加到 PhotoViewController:
#import "hotoViewController.h"
#import "hotoSet.h"
@implementation PhotoViewController
@synthesize photoSet = _photoSet;
- (void) viewDidLoad {
[[TTURLRequestQueue mainQueue] setMaxContentLength:0];
TTNavigator *navigator = [TTNavigator navigator];
UIWindow *window = [UIApplication sharedApplication].keyWindow;
navigator.window = window;
TTURLMap *map = navigator.URLMap;
[map from"tt://appPhotos" toSharedViewController:[PhotoViewController class]];
[navigator openURLAction:[TTURLAction actionWithURLPath"tt://appPhotos"]];
self.photoSource = [PhotoSet samplePhotoSet];
}
- (void) dealloc {
self.photoSet = nil;
}
@end
这是在根选项卡 Controller 中单击“图库”选项卡后的结果图像:
这几乎没问题,但我有一些问题:
我认为 MWPhotoBrowser界面比 EGOPhotoViewer 更好(感觉更接近原生照片应用)。
MWPhotoBrowser is an implementation of a photo browser similar to the native Photos app in iOS. It can display one or more images by providing either UIImage objects, file paths to images on the device, or URLs to images online. The photo browser handles the downloading and caching of photos from the web seamlessly. Photos can be zoomed and panned, and optional (customisable) captions can be displayed. Works on iOS 3.2+. All strings are localisable so they can be used in apps that support multiple languages.
关于objective-c - Three20:照片查看器自定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8324516/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |