2012-05-08 19 views
1

アイコンをクリックすると、ビュー上に画像アイコンが表示され、別のビュー(他のxib)が開き、キーボードが開くようになり、画面は下から30%しか表示されず、アイコンをクリックすると5つのアイコンが表示されます。現在のアイコンは選択したアイコンに置き換えてください。ipad apps.thanks all。ナビゲーションなしでipadアプリケーションのボタンをクリックしてビューを開く(別のxib)

+0

ビューがキーボードのように表示されます。 –

+0

use presentModel.presentModelは、キーボードのように開くことができます。 –

+0

レスポンスありがとう、不完全な質問を申し訳ありませんが、実際には私がしなければならないのは、5つの画像を含むサイズが小さい別の画像がクリックされた画像をクリックすることです。 ipadアプリケーションの画像。 –

答えて

1

使用この: - をのviewDidLoadで枠を与えますあなたの画面の30%しかカバーしないように、youranotherviewcontrollerのサイズも同様です。 -

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 
{ 
    UITouch *touch = [[event allTouches] anyObject]; 

    CGPoint startLocation = [touch locationInView:self.view]; 
    if([touch view]==yourFirstImageIcon) 
    { 
     // alloc this youranotherviewcontroller in ViewDidLoad 
     [self presentModalViewController:youranotherviewcontroller animated:Yes]; 
     //It will show your another View having five more icons like keyboard 
    } 
} 
+0

kありがとうございました....... –

+0

それはうまくいくのですか? –

+0

作品.......細かい –

1
[self.view addSubview:youranotherviewcontroller.view]; 

または

[self presentModalViewController:youranotherviewcontroller animated:NO]; 

私は同じのために、次のリンゴのガイドラインを読むことをお勧めしたいです。それはあなたにもっと役立つかもしれません。

About View Controllers

希望、これは私はあなただけ試してみて、私は、これはアプリ内を検索しますハウズ伝えるためのコード行は役に立ちだと思います

+0

質問を変更する必要があります。 – Nit

1
ViewController *viewController=[[ViewController alloc]initWithNibName:@"ViewController" bundle:nil]; 
viewController.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;//any type you want use that 
[self presentModalViewController:viewController animated:YES]; 

のに役立ちます。

+0

もし私が質問に従って間違っていたら、once3を教えてください。ありがとう – vishiphone

+0

詳細については私の編集した質問をご覧ください.....ありがとう –

+0

なぜあなたは別のxibを使っているのですか?あなたにとってより簡単です。 – vishiphone

1

どちらかあなたが効果を上にスライド、またはあなたがアニメーションで同胞のビューを追加することができます与えるモーダルビューのアプローチを使用することができ、あなたはこれを確認することができます -

UIView *myAnimationView = [[UIView alloc] initWithFrame:self.view.frame]; 
myAnimationView.backgroundColor = [UIColor blueColor]; 
[self.view addSubview:myAnimationView]; 

[myAnimationView setFrame:CGRectMake(0, 480, 320, 480)]; 
[myAnimationView setBounds:CGRectMake(0, 0, 320, 480)]; 

[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDuration:1.0]; 
[UIView setAnimationDelegate:self]; 
[myAnimationView setFrame:CGRectMake(0, 0, 320, 480)]; 
[UIView commitAnimations]; 
関連する問題