저는 아래쪽에 탭이있는 앱을 만들려고했지만 tabbr 앱이 표시하는 펜촉에서 내 자신의 링크로보기를 전환 할 수있는 기능이 있습니다.Xcode TabBar 앱 - 여러보기?
이 예제를 찾으려고했지만 xcode 4.2 (ios5.0 이전이든 아니든)는 mainwindow.xib를 만들지 않으므로 다음과 같이 프로그래밍 방식으로이 메서드를 만들어야합니다.
#import "AppDelegate.h"
#import "HomeViewController.h"
#import "ViewListViewController.h"
#import "ShareViewController.h"
#import "FriendsViewController.h"
#import "SettingsViewController.h"
@implementation AppDelegate
@synthesize window = _window;
@synthesize tabBarController = _tabBarController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
UIViewController *homeViewController = [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil];
UIViewController *viewListViewController = [[ViewListViewController alloc] initWithNibName:@"ViewListViewController" bundle:nil];
UIViewController *shareViewController = [[ShareViewController alloc] initWithNibName:@"ShareViewController" bundle:nil];
UIViewController *friendsViewController = [[FriendsViewController alloc] initWithNibName:@"FriendsViewController" bundle:nil];
UIViewController *settingsViewController = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController" bundle:nil];
self.tabBarController = [[UITabBarController alloc] init];
[self.tabBarController setDelegate:self];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:homeViewController, viewListViewController, shareViewController, friendsViewController, settingsViewController, nil];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
내 AppDelegate.m의이 코드는 제대로 작동하며 탭 사이를 완벽하게 전환 할 수 있습니다. 내가 가지고있는 문제는 페이지에 그래픽을 추가하고이를 데이터베이스에서 데이터를 추가/편집/삭제하기위한 뷰를 전환하는 버튼으로 사용한다는 것입니다 (다음에 수행해야 할 별도의 문제).
대부분의 예에서 TabBar 또는 uiNavigation과 UIView를 사용하여 앱을 시작합니다. 나는 내가하고 싶은 일을하는 법을 분명히 보여주는 모범을 아직 찾지 못했다. 이 기본 템플릿으로 tabBar 응용 프로그램을 만드는 방법이 잘못 되었습니까? 아니면이 작업을 수행 할 수 있습니까? 각 탭에는 기능을 수행하는 여러보기가있을 수 있지만 tabBar 프레임 워크 내에서 이들을 만들고 전환 할 수 있어야합니다. 사전에
덕분에,
실버 타이거
-UPDATE : -
조금을 읽은 후 지금 aUINavigationController 내가 무엇을 찾고 아니라고 생각하고있다. 내가 필요한 것은 사용자 정의 버튼을 사용하여보기를 전환 할 수있게 만드는 것입니다. 콘텐츠에서 사용할 버튼은 그래픽이거나 그래픽 배경 위에 투명하게 표시됩니다. TabBar를 항상 표시 상태로 유지하면서 사용자 지정 단추를 사용하여 새보기를 밀어 넣을 수 있습니까? 난 단지 정말 내가 새보기를 밀어 것입니다 탭 2을 거라고하지만 UINavigationController가 난 아니에요 때문에 내가 사용하고있는 방법에 적합하지 않는 것 같은 그래서 본질적으로
Home
Add
Edit
delete
ViewList - Single page to view list
Share - Single page to send emails/invites
Friends
Add
Edit
Delete
Settings - Single page for app settings/preferences
아래 내 구조는 것 보기를 전환하기 위해 위쪽의 단일 막대를 사용합니다.
자세한 내용은 고맙습니다. 그것을 읽은 후 나는 UINavigationController를 사용하여 내가 필요로하지 않을 수 있습니다 찾으십시오. 정말 필요한 것은보기를 전환 할 수있는 사용자 지정 단추입니다. 나는 내가 찾고있는 것에 대한 더 나은 아이디어로 나의 원래 묘사를 갱신 할 것이다. – Silvertiger