• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

objective-c - Three20:照片查看器自定义

[复制链接]
菜鸟教程小白 发表于 2022-12-12 18:21:35 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

我的应用程序中需要一个图库,我找到了有关如何在我的应用程序中实现 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 中单击“图库”选项卡后的结果图像: Gallery

这是我在 View 中滚动时的图像: Problem with scroll

这几乎没问题,但我有一些问题:

  1. 当我选择图库并出现上述 View 时,无法返回到根标签 Controller 。如何添加后退按钮?
  2. 当我在图库中滑动时,会显示文本“错误”一段时间,直到图像完全加载。为什么?
  3. 当我选择“查看全部”时,它会显示所有图像的列表。如何更改顶部导航栏的背景颜色?



Best Answer-推荐答案


我认为 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/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap