ご教授お願い出来ないでしょうか。
現在は表示画像(この画像はページとして横にスクロールできる使用)をタップすると下からツールバー(半透明)が出てきます。ここのツールバーではページの「戻る」「進む」などのボタンが配置されています。
このツールバーにサムネイルスクロールビュー(メイン画像を小さくしたものでスクロールできる)を設置して、画像を押すと、メインのフルサイズ画像のページへ飛ぶようにしたいです。
下記が現在のコードとなります。
ツールバー部分▼ ファイル名:MWPhotoBrowser.m
// Toolbar
_toolbar = [[UIToolbar alloc] initWithFrame:[self frameForToolbarAtOrientation:self.interfaceOrientation]];
_toolbar.tintColor = nil;
if ([[UIToolbar class] respondsToSelector:@selector(appearance)]) {
[_toolbar setBackgroundImage:nil forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];
[_toolbar setBackgroundImage:nil forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsLandscapePhone];
}
_toolbar.barStyle = UIBarStyleBlackTranslucent;
_toolbar.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth;
// Toolbar Items
_previousButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"MWPhotoBrowser.bundle/images/UIBarButtonItemArrowLeft.png"] style:UIBarButtonItemStylePlain target:self action:@selector(gotoPreviousPage)];
_nextButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"MWPhotoBrowser.bundle/images/UIBarButtonItemArrowRight.png"] style:UIBarButtonItemStylePlain target:self action:@selector(gotoNextPage)];
_actionButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(actionButtonPressed:)];
フルサイズ表示画像部分(サムネイルからこの画像へ飛ばしたいです)▼ ファイル名:Menu.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Browser
NSMutableArray *photos = [[NSMutableArray alloc] init];
MWPhoto *photo;
switch (indexPath.row) {
case 0:
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@”photo00left” ofType:@”jpg”]];
[photos addObject:photo];
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@”photo00right” ofType:@”jpg”]];
[photos addObject:photo];
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@”photo01″ ofType:@”jpg”]];
[photos addObject:photo];
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@”photo02″ ofType:@”jpg”]];
[photos addObject:photo];
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@”photo03″ ofType:@”jpg”]];
[photos addObject:photo];
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@”photo04″ ofType:@”jpg”]];
[photos addObject:photo];
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@”photo05″ ofType:@”jpg”]];
[photos addObject:photo];
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@”photo06″ ofType:@”jpg”]];
[photos addObject:photo];
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@”photo07″ ofType:@”jpg”]];
[photos addObject:photo];
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@”photo08″ ofType:@”jpg”]];
[photos addObject:photo];
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@”photo09″ ofType:@”jpg”]];
[photos addObject:photo];
photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@”photo10″ ofType:@”jpg”]];
[photos addObject:photo];
break;
}
self.photos = photos;
// Create browser
MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self];
browser.displayActionButton = YES;
//browser.wantsFullScreenLayout = NO;
//[browser setInitialPageIndex:2];
// Show
if (_segmentedControl.selectedSegmentIndex == 0) {
// Push
[self.navigationController pushViewController:browser animated:YES];
}
// Release
[browser release];
[photos release];
// Deselect
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
}