0

キーボード コントロールのような [完了] ボタンを使用して UIDatePicker をスライドさせる方法を知っている人はいますか? もしそうなら、その方法についていくつかのサンプルコードを共有できますか. ありがとう

4

2 に答える 2

1

UIViewControllerを使用してモーダルに表示することをお勧めします。

UIViewControllerView Controller の場合と同様に、Interface Builder で [OK] ボタンを使用してビューを作成およびセットアップします。

そして、次を使用して表示します。

- (void)presentModalViewController:(UIViewController *)modalViewController 
                          animated:(BOOL)animated

透明にしたい場合は、ルート ビューの背景をクリアに設定できます。オプションで、トランジションが終了したら、半透明の黒にアニメーション化します。次のようなものが機能します。

- (void)viewDidAppear:(BOOL)animated {
  if (animated) [UIView beginAnimations:@"fadeDark" context:NULL];
  self.view.backgroundColor = [UIColor colorWithWithe:0.0f alpha:0.5f];
  if (animated) [UIView commitAnimations];
}
于 2009-08-28T20:21:56.883 に答える