问题描述
说明:如果我设置为[[[UIScrollView外观] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];”在我应用程序的其他位置,CNContactPicerViewController中的前两个项目将被覆盖,无法被触摸。在出现“ Contact Picer”之前将UIScrollViewContentInsetAdjustmentAutomatic设置回前将有助于前两个项目可触摸,但是联系人列表的初始位置不正确。
- (IBAction)chooseFromContact:(id)sender {
if (@available(iOS 11.0,*)){
[[UIScrollView appearance] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
}
ContactManager *contactManager = [ContactManager sharedInstance];
[contactManager selectContactAtController:self complection:^(Nsstring * _Nonnull phone) {
NSLog(@"Hello World");
}];
}
// in ContactManager.m
- (void)selectContactAtController:(UIViewController *)controller
complection:(void (^)(Nsstring *))completcion {
if (@available(iOS 11.0,*)){
[[UIScrollView appearance] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentAutomatic];
}
self.contactPicker = [[CNContactPickerViewController alloc] init];
self.contactPicker.delegate = self;
[controller presentViewController:self.contactPicker animated:YES completion:nil];
self.currentViewController = controller;
self.didselectPhone = completcion;
}
预期结果:
实际结果:
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)