gpt4 book ai didi

ios - 有什么办法可以在取消 UIPopoverController 的同时允许触摸取消按钮吗?

转载 作者:行者123 更新时间:2023-11-29 04:09:49 24 4
gpt4 key购买 nike

我们有一个 uipopovercontroller,显示用户可以做出的一些选择。附近有一个开始搜索的 GO 按钮。我们需要关闭弹出窗口,但仍然允许一键触发 GO 按钮。过去,我们使用手动弹出控件来轻松处理此问题,这也是客户所习惯的。关于如何获得此行为但使用 Apple 的 UIPopoverController 解雇有什么想法吗?

最佳答案

首先我会检查passthroughViews。它们将允许您告诉它在弹出窗口处于事件状态时允许触摸该按钮。

passthroughViews

An array of views that the user can interact with while the popover is visible.

@property (nonatomic, copy) NSArray *passthroughViews Discussion When a popover is active, interactions with other views are normally disabled until the popover is dismissed. Assigning an array of views to this property allows taps outside of the popover to be handled by the corresponding views.

Availability Available in iOS 3.2 and later.

接下来,在 GO 按钮选择器中,您只需要通过关闭来处理弹出窗口:

[popoverController dismissPopoverAnimated:YES];

关于ios - 有什么办法可以在取消 UIPopoverController 的同时允许触摸取消按钮吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14589659/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com