0

我有一个 Iphone 应用程序,我想在其中添加一个功能,这样当用户点击一个按钮时,它会弹出一个带有一些文本的视图。当他再次点击它时,我需要另一个文本。有人可以帮我怎么做吗?

4

1 回答 1

1

听起来您需要提供一个模态视图控制器。您将创建一个UIViewController来管理您想要“弹出”的视图。然后用于presentModalViewController:显示视图。

YourPopUpViewController *vc = [[YourPopUpViewController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:vc animated:YES];

回过头来,您在YourPopUpViewController.

[self dismissModalViewControllerAnimated:YES];
于 2012-04-19T17:08:16.810 回答