gpt4 book ai didi

ios 13 导航控件在 CNContactViewController 中向下滑动选择器以添加个人资料图片时消失?

转载 作者:行者123 更新时间:2023-11-29 05:24:03 25 4
gpt4 key购买 nike

enter image description here点击添加照片后 enter image description here
观察滑下 Controller cancel时,newcontact和done消失。
enter image description here

var contact = new CNMutableContact
{
// Given and family names.
FamilyName = participant.LastName,
GivenName = participant.FirstName,
//Note = participant.Note,
OrganizationName = participant.Company,

};
if (!string.IsNullOrEmpty(participant.IconUrl))
{
NSUrl url = new NSUrl(participant.IconUrl);
UIImage image = UIImage.LoadFromData(NSData.FromUrl(url));
NSData data = image.AsPNG();
contact.ImageData = data;
}
var contactViewController = CNContactViewController.FromNewContact(contact);

contactViewController.Delegate = this;

在本节中,我们添加与现有数据的联系人。然后添加 contactview Controller 作为当前 View Controller 。

var nc = new UINavigationController(contactViewController);
this.PresentViewController(nc, true, () => {
});

最佳答案

假设您在 iOS 8 的更高版本上运行此程序,Swift 现在可以启用禁用导航栏 View 的滚动。 (如果我们谈论的是同一件事。)我认为问题在于您的导航 Controller 而不是上面的代码。

您可以使用self.navigationController?.hidesBarsOnSwipe = false

禁用滚动和滑动时导航栏的隐藏,尽管这要求您的 ViewController 嵌入到 NavigationController 中。 NavigationController 的所有子 VC 都会继承此行为,因此您可能需要在 viewWillAppear 中启用/禁用它。

您还可以通过设置导航 Controller -> shownavigationbar 在 Storyboard中禁用此功能

storyboard Hierarchy Attribute section of the navigation controller

关于ios 13 导航控件在 CNContactViewController 中向下滑动选择器以添加个人资料图片时消失?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58370621/

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