Ios在选项卡式应用程序中从UITableView启动Fgallery
我正在尝试构建一个小应用程序。这是一款有3个标签的应用程序:照片、视频、文档 每个选项卡显示一个tableview,用于选择要显示的库、视频、文档;视频效果很好 我在照片库方面遇到了麻烦。我使用的Fgallery从样本中可以很好地工作: H 及 我真的不知道如何展示这个画廊。didSelectRowAtIndexPath是来自fgallery的路径,我试图修改它以显示viewm,但我是Objective-C的新手,我被卡住了 任何帮助或指导都将不胜感激 谢谢我补充道Ios在选项卡式应用程序中从UITableView启动Fgallery,ios,uitableview,view,photo-gallery,tabbed-interface,Ios,Uitableview,View,Photo Gallery,Tabbed Interface,我正在尝试构建一个小应用程序。这是一款有3个标签的应用程序:照片、视频、文档 每个选项卡显示一个tableview,用于选择要显示的库、视频、文档;视频效果很好 我在照片库方面遇到了麻烦。我使用的Fgallery从样本中可以很好地工作: H 及 我真的不知道如何展示这个画廊。didSelectRowAtIndexPath是来自fgallery的路径,我试图修改它以显示viewm,但我是Objective-C的新手,我被卡住了 任何帮助或指导都将不胜感激 谢谢我补充道 if( indexPath.
if( indexPath.row == 0 ) {
NSLog( @"selection 1");
localGallery = [[FGalleryViewController alloc] initWithPhotoSource:self];
// Create the navigation controller and present it modally.
UINavigationController *navigationController = [[UINavigationController alloc]
initWithRootViewController:localGallery];
[self presentModalViewController:navigationController animated:YES];
视图现在显示ok,但我缺少FGalleryViewController.m中的后退按钮,我将btn2添加到导航控制器
- (void)setUseThumbnailView:(BOOL)useThumbnailView
{
_useThumbnailView = useThumbnailView;
if( self.navigationController ) {
if (_useThumbnailView) {
UIBarButtonItem *btn = [[UIBarButtonItem alloc] initWithTitle:@"See All" style:UIBarButtonItemStylePlain target:self action:@selector(handleSeeAllTouch:)] ;
[self.navigationItem setRightBarButtonItem:btn animated:YES];
UIBarButtonItem *btn2 = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(dismissModalViewControllerAnimated:)] ;
[self.navigationItem setLeftBarButtonItem:btn2 animated:YES];
}
else {
[self.navigationItem setRightBarButtonItem:nil animated:NO];
}
}
}
瞧,我试图添加[self.view addSubview:localGallery.view];没有效果。我不理解观点的概念。。。
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog( @"Choix Table");
if( indexPath.row == 0 ) {
NSLog( @"selection 1");
localGallery = [[FGalleryViewController alloc] initWithPhotoSource:self];
[self.navigationController pushViewController:localGallery animated:YES];
}
else if( indexPath.row == 1 ) {
networkGallery = [[FGalleryViewController alloc] initWithPhotoSource:self];
[self.navigationController pushViewController:networkGallery animated:YES];
...
}
if( indexPath.row == 0 ) {
NSLog( @"selection 1");
localGallery = [[FGalleryViewController alloc] initWithPhotoSource:self];
// Create the navigation controller and present it modally.
UINavigationController *navigationController = [[UINavigationController alloc]
initWithRootViewController:localGallery];
[self presentModalViewController:navigationController animated:YES];
- (void)setUseThumbnailView:(BOOL)useThumbnailView
{
_useThumbnailView = useThumbnailView;
if( self.navigationController ) {
if (_useThumbnailView) {
UIBarButtonItem *btn = [[UIBarButtonItem alloc] initWithTitle:@"See All" style:UIBarButtonItemStylePlain target:self action:@selector(handleSeeAllTouch:)] ;
[self.navigationItem setRightBarButtonItem:btn animated:YES];
UIBarButtonItem *btn2 = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(dismissModalViewControllerAnimated:)] ;
[self.navigationItem setLeftBarButtonItem:btn2 animated:YES];
}
else {
[self.navigationItem setRightBarButtonItem:nil animated:NO];
}
}
}