简体   繁体   English

是否可以为 CNContactViewController 添加自定义导航栏?

[英]Is it Possible to add a custom Navigation Bar for CNContactViewController?

I want to create a custom UINavigationBar for CNContactViewController in order to select single or multiple contact.我想为CNContactViewController创建自定义UINavigationBar以选择单个或多个联系人。 The default UINavigationBar consists of Cancel,Done and Group button which makes it look quite messy.默认的UINavigationBar由 Cancel、Done 和 Group 按钮组成,这让它看起来很乱。 Is there a workaround to customize the UINavigationBar of the CNContactViewController ?是否有解决方法来自customize CNContactViewControllerUINavigationBar Can Anyone answer this asap?谁能尽快回答这个问题? 这是我的页面现在的样子

Your screenshot is CNContactPickerViewController , not CNContactViewController .您的屏幕截图是CNContactPickerViewController ,而不是CNContactViewController But the answer is the same for both.但两者的答案是一样的。

The Contacts view controllers each have a very specific purpose: choosing a contact, creating a contact, etc. They each have a navigation bar suited to that purpose — the contact pocket needs that Done button so the user can select a contact and return control to your app.每个 Contacts 视图控制器都有一个非常具体的目的:选择一个联系人,创建一个联系人等。它们每个都有一个适合该目的的导航栏——联系人口袋需要完成按钮,这样用户就可以选择一个联系人并返回控制权你的应用程序。 And they're hosted out of process so that malicious apps can't dig inside to harvest contact info they're not supposed to.而且它们在进程外托管,因此恶意应用程序无法深入内部以获取他们不应该获取的联系信息。

Since it's out of process, you can't customize the navigation bar directly.由于是进程外,不能直接自定义导航栏。 Contacts would need to define an API for that, and it doesn't.联系人需要为此定义一个 API,但它不需要。 Perhaps you should file a feature request for that?也许您应该为此提交功能请求 Then again, I'm not sure what the use case for removing any of those buttons is...再说一次,我不确定删除任何这些按钮的用例是什么......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM