gpt4 book ai didi

iphone - 禁止点击背景 UIViewController

转载 作者:行者123 更新时间:2023-11-29 13:14:17 26 4
gpt4 key购买 nike

我在点击 UITableViewCell 时加载了 ABPeoplePickerNavigationController

self.peoplePicker = [[ABPeoplePickerNavigationController alloc] init];
self.peoplePicker.peoplePickerDelegate = self;
[self.peoplePicker setDelegate:self];
self.peoplePicker.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:self.peoplePicker animated:YES completion:nil];

When the picker is presented as UIModalPresentationFormSheet, I want to disable the UIViewController behind it.为此,我可以在呈现选择器时加载一个透明 View ,并在选择器被关闭时将其关闭。所以在 viewcontroller 上点击将不起作用。我想知道是否有另一种方法可以做到这一点,我不需要创建新的 UIView 并加载/关闭它。

最佳答案

在呈现 Picker View 之前和关闭 Picker View 之后,您可以在 ViewController 的 View 上setUserInteractionEnabled 属性。

关于iphone - 禁止点击背景 UIViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16230215/

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