私は下部にタブを持つアプリケーションを作成するように働いていますが、tabBarアプリケーションが表示するペン先の自分のリンクでビューを切り替えることができます。Xcode TabBarアプリ - 複数のビュー?
私はこの例を見つけるしようとしているが、Xcodeの4.2(かios5.0上またはそれ以前)mainwindow.xibを作成していないので、私は次のようにprogrammataiicallyこれを作成する方法を見つけなければならなかったされています:
#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のこのコードはうまく動作し、タブ間を完全に切り替えることができます。私が抱えている問題は、ページにグラフィックスを追加し、データベースからデータを追加/編集/削除するためのビューを切り替えるためのボタンとして使用することです(別の問題は次に行うことです)。
ほとんどの例では、タブバーまたはUIViewを使用したUIナビゲーションを使用してアプリを起動しています。私は、私が探していることをどうやって行うのかをはっきりと示す例をまだ見つけていません。私のアプローチは、このための基本テンプレートとして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