アイコンをクリックすると、ビューに画像アイコンが表示されます。別のビュー (他の xib) が開き、キーボードが開くように表示され、画面を下から 30% だけカバーする必要があります。現在のアイコンをクリックすると 5 つのアイコンが表示されます。選択したアイコンに置き換える必要があります。これは iPad アプリです。すべてに感謝します。
2232 次
4 に答える
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];
于 2012-05-08T05:21:37.233 に答える
1
ViewController *viewController=[[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
viewController.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;//any type you want use that
[self presentModalViewController:viewController animated:YES];
このコード行は、アプリでこれがどのように見えるか教えてください。
于 2012-05-08T05:09:39.810 に答える
1
これを使用してください:- ViewDidLoad で、別のビューコントローラーのフレームサイズを同様に指定して、画面の 30% のみをカバーするようにします。その後:-
- (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
}
}
于 2012-05-08T06:03:19.570 に答える
1
[self.view addSubview:youranotherviewcontroller.view];
また
[self presentModalViewController:youranotherviewcontroller animated:NO];
同じことについて、次のアップルのガイドラインを読むことをお勧めします。それはあなたをもっと助けるかもしれません。
うまくいけば、これはあなたを助けるでしょう
于 2012-05-08T05:02:51.610 に答える