如何将按钮添加到 iPad 应用程序的弹出视图中

发布于 2024-10-03 03:59:57 字数 147 浏览 5 评论 0原文

我想添加一些文本字段和按钮到弹出视图...

如何添加这些,我必须读取用户稍后添加到文本字段中的文本...

....我是否需要单独的视图控制器类控制弹出视图,或者我可以用现有的调用弹出视图的视图进行控制....

任何帮助表示赞赏..

i want to add some text fields and the buttons to the popover view ...

how to add those and i hav to read the text added into text field by user later ...

....should i need seperate view controller class to control popover view or can i control with existed one which calls popover view....

any help Appreciated..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一影成城 2024-10-10 03:59:57

使用 IB 或以编程方式创建 UIViewController。添加所需的按钮、文本字段以及可能的一些逻辑,并使用此 viewController 来初始化 UIPopoverController (如 Gendolkari 建议的那样)。

Create a UIViewController using IB or programatically. Add needed buttons, textfields and maybe some logic there and use this viewController for initializing an UIPopoverController (as Gendolkari suggested).

暗地喜欢 2024-10-10 03:59:57

UIPopoverView 是通过传入控制弹出窗口内容的 ViewController 来创建的。查看 initWithContentViewController:,它允许您传递自己的 ViewController。该 ViewController 将具有一个包含您想要的文本字段和按钮的视图。

The UIPopoverView is created by passing in a ViewController which controls the content of your popover. Check out the initWithContentViewController:, this allows you to pass your own ViewController. That ViewController would have a view with the text fields and button that you want.

成熟的代价 2024-10-10 03:59:57

尝试使用这个:

UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];

[button addTarget:self 
        action:@selector(aMethod:)
        forControlEvents:UIControlEventTouchDown];

[button setTitle:@"Show View" forState:UIControlStateNormal];

button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0);

[self.tableView addSubview:button];

Try using this:

UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];

[button addTarget:self 
        action:@selector(aMethod:)
        forControlEvents:UIControlEventTouchDown];

[button setTitle:@"Show View" forState:UIControlStateNormal];

button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0);

[self.tableView addSubview:button];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文