Jon
unread,Nov 15, 2011, 4:29:07 PM11/15/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Nimbus iOS Framework
Are there any examples available using NIToolbarPhotoViewController
with non-network images? I have the images in my application bundle
that I would like to present through this class. I have tried a few
tweaks of the NetworkPhotoAlbum example with my own subclass
(subclassing NIToolbarPhotoViewControlle directly, not
NetworkPhotoAlbumViewController). However, even when I hardcode the
following two methods in my subclass to return an image using +
imageNamed, I get blank screen.
- (UIImage *)photoAlbumScrollView: (NIPhotoAlbumScrollView
*)photoAlbumScrollView
photoAtIndex: (NSInteger)photoIndex
photoSize: (NIPhotoScrollViewPhotoSize
*)photoSize
isLoading: (BOOL *)isLoading
originalPhotoDimensions: (CGSize *)originalPhotoDimensions
- (UIImage *)photoScrubberView: (NIPhotoScrubberView
*)photoScrubberView
thumbnailAtIndex: (NSInteger)thumbnailIndex
Based on my current understanding, it seems that any class should be
able to subclass NIToolbarPhotoViewController and implement these two
methods below as a very basic start. However, even with these two
datasource methods implemented as shown, I receive a blank screen.
Though, I still get the view showing the correct photo count (4 of 10,
for example) and can click through using the forward/back arrows, I
end up with no actuall images displaying. I was expecting the
default.png to show up 10 times.
- (NSInteger)numberOfPhotosInPhotoScrollView:(NIPhotoAlbumScrollView
*)photoScrollView {
return 10;
}
- (UIImage *)photoAlbumScrollView: (NIPhotoAlbumScrollView
*)photoAlbumScrollView
photoAtIndex: (NSInteger)photoIndex
photoSize: (NIPhotoScrollViewPhotoSize
*)photoSize
isLoading: (BOOL *)isLoading
originalPhotoDimensions: (CGSize *)originalPhotoDimensions {
return [UIImage imageWithContentsOfFile:
NIPathForBundleResource(nil, @"NimbusPhotos.bundle/gfx/
default.png")];
}