0

UIView内でpresentViewControllerを使用しようとしています。

http://img145.imageshack.us/img145/6334/appt.png

上部/右側の「+」ボタンをクリックすると、右側(画像の灰色の部分)のテーブルビューをUIViewControllerに置き換えたいと思います。

- (void)add:(id)sender
{
UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"testview"];
[self presentViewController:controller animated:YES completion:NULL];
}

もちろん、これを行うことで、画面全体が置き換えられます..次のようなものが欲しいです:

[contentView addSubview:controller];

また

[contentView presentViewController:controller animated:YES completion:NULL];

contentView は、テーブルビューを含む UIView です

このaddChildViewControllerとpresentViewControllerを見つけましたが、それが私を助けることができるとは思いません

ありがとう

編集:

ストーリーボードで ContainerView を使用すると問題が解決しました

4

5 に答える 5

0

私はあなたのことを正しく理解しているかどうか確信が持てません。あなたの写真から、あなたはiPad用にプログラミングしていると思います.ビュー全体を別のビューで部分的にカバーしたいと考えています. もしそうなら、UIPopoverControllerまさにこれを行う a を使用できます。

于 2013-04-03T12:22:08.323 に答える