objective-c - Three20:照片查看器自定义
<p><p>我的应用程序中需要一个图库,我找到了有关如何在我的应用程序中实现 Three20 的教程:<a href="http://www.raywenderlich.com/1430/how-to-use-the-three20-photo-viewer" rel="noreferrer noopener nofollow">http://www.raywenderlich.com/1430/how-to-use-the-three20-photo-viewer</a> .</p>
<p>我有一个 Storyboard ,其中根是标签栏 Controller 。这个根 Controller 与上面教程中的类 <em>PhotoViewController</em> 的 ViewController 有关系。</p>
<p>本教程的最后一步是将代码添加到 AppDelegate,但在我的例子中,我将此代码添加到 PhotoViewController:</p>
<pre><code>#import "PhotoViewController.h"
#import "PhotoSet.h"
@implementation PhotoViewController
@synthesize photoSet = _photoSet;
- (void) viewDidLoad {
[ setMaxContentLength:0];
TTNavigator *navigator = ;
UIWindow *window = .keyWindow;
navigator.window = window;
TTURLMap *map = navigator.URLMap;
];
];
self.photoSource = ;
}
- (void) dealloc {
self.photoSet = nil;
}
@end
</code></pre>
<p>这是在根选项卡 Controller 中单击“图库”选项卡后的结果图像:
<a href="/image/k9nBf.png" rel="noreferrer noopener nofollow"><img src="/image/k9nBf.png" alt="Gallery"/></a>
</p>
<p>这是我在 View 中滚动时的图像:
<a href="/image/Y68kq.png" rel="noreferrer noopener nofollow"><img src="/image/Y68kq.png" alt="Problem with scroll"/></a>
</p>
<p>这几乎没问题,但我有一些问题:</p>
<ol>
<li>当我选择图库并出现上述 View 时,无法返回到根标签 Controller 。如何添加后退按钮?</li>
<li>当我在图库中滑动时,会显示文本“错误”一段时间,直到图像完全加载。为什么?</li>
<li>当我选择“查看全部”时,它会显示所有图像的列表。如何更改顶部导航栏的背景颜色?</li>
</ol></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>我认为 <a href="http://github.com/mwaterfall/mwphotobrowser" rel="noreferrer noopener nofollow">MWPhotoBrowser</a>界面比 EGOPhotoViewer 更好(感觉更接近原生照片应用)。</p>
<blockquote>
<p>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.</p>
</blockquote></p>
<p style="font-size: 20px;">关于objective-c - Three20:照片查看器自定义,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/8324516/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/8324516/
</a>
</p>
页:
[1]