2011-03-03 5 views
1

私はViewControllerをUINavigationControlerを使用しないで別のコントローラにナビゲートする方法はありますか?私はそれをどのように行うことができ、

の私のviewDidLoad
- (void)viewDidLoad { 
[super viewDidLoad]; 
UIImageView* view = [[UIImageView alloc] initWithImage: [UIImage imageNamed: @"logo.png"]]; 
view.frame = CGRectMake(300, 200, 200, 350); 
[self.view addSubview:view]; 


UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(300, 800, 200, 50)]; 
label.textColor = [UIColor blackColor]; 
[label setBackgroundColor:[UIColor clearColor]]; 
[label setFont:[UIFont systemFontOfSize:30]]; 
[label setText: @"Tap to Enter"]; 

[self.view addSubview:label]; 
[label release]; } 

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 
    NSLog(@"Hello, You Tapped !"); } 

でコーディング以下の今、私は別のコントローラにタップして切り替えたいていると私は彼らのUITabBarControllerをしたいですか?

誰もが明確でない場合は、別のコントローラに移動する必要があるタップのボタンを取り、私に再び

答えて

1

新しいコントローラをmodelviewControllerとして呼び出すことができます。これは、newController init tabControllerのviewDidLoadの1つのオプションです。そこ..

UIViewController *newViewController = [[UIViewController alloc] init]; 
[self presentModalViewController:newViewController animated:YES]; 

.ORあなたは左と外側の画面の左側に、現在のコントローラのビューをプッシュするために、右からの新しいコントローラのビューをアニメーション化することができます右left..Youからのナビゲーションをプッシュしたい場合もう一つのオプションですが、私は最初にお勧めします...

1

を求めることができます。ボタンのメソッドを記述し、新しいコントローラのview did loadメソッドでtabbarcontrollerを開始します。

関連する問題