在Titanium Mobile中找到当前的viewController来推送ABPersonViewController
在我正在开发的应用程序中,我需要与 iPhone 的地址簿进行交互。
目前,Titanium mobile 不公开本机小部件,因此我决定编写一个模块来尝试克服此限制。
据我所知,更改 navigationControl 的唯一方法是通过 showModalController
[[TiApp app] showModalController:picker animated:animated];
,它将模式控制器添加到当前视图,但它对我的应用程序来说毫无用处,因为它是选项卡式的。 我需要的是一种将我的 viewController 推送到嵌入当前选项卡中的当前视图控制器上的方法。
有什么干净方法可以达到这个结果吗?
该功能是一个阻碍,所以如果我很快找不到方法,我必须切换到本机实现:-(
in an application I'm working on, I need to interact with iPhone's AddressBook.
Currently, Titanium mobile doesn't expose the native widget so I decided to write a module to trying to overcome this limitation.
As far as I know, the only way to change a navigationControl is through showModalController
[[TiApp app] showModalController:picker animated:animated];
which adds a modal controller to current view, but it's useless for my app, because it's tabbed.
What I need is a way to push my viewController onto the current one, embedded in current tab.
Is there any clean way to reach this result?
That feature is a show stopper, so if I don't find a way soon, I've to switch to native implementation :-(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Titanium 将使用
Ti.Contacts.showContacts
方法 (doc)。此外,您应该能够将
showModalController:animated:
与选项卡式视图一起使用。模态视图将覆盖选项卡直至关闭,但这就是模态视图在 iPhone 上的工作方式。Titanium will show the native contact picker (ABPeoplePickerNavigationController) with the
Ti.Contacts.showContacts
method (doc).Also, you should be able to use
showModalController:animated:
with a tabbed view. The modal view will cover the tabs until dismissed, but that's how modal views work on the iPhone.