gpt4 book ai didi

ios - 带有 iOS 标签栏 Controller 的 Braintree 嵌入式 UI

转载 作者:行者123 更新时间:2023-11-30 11:35:04 25 4
gpt4 key购买 nike

我正在尝试在我的 iOS 应用程序中实现 Braintree 嵌入式 UI。
我正在展示来自选项卡栏 Controller Controller 的 View 之一的嵌入式用户界面。当我尝试在显示下拉列表时切换选项卡时,我的问题就开始了。下拉式用户界面“后面”的 View 变黑,直到我关闭下拉式菜单后才会返回。
我想最好的解决方案是当用户切换到另一个选项卡时关闭该插件,但我不知道如何实现它。

为了展示这个插件,我使用了 Braintree 文档中的代码:

func showDropIn(clientTokenOrTokenizationKey: String) {
let request = BTDropInRequest()
let dropIn = BTDropInController(authorization: clientTokenOrTokenizationKey, request: request)
{ (controller, result, error) in
if (error != nil) {
print("ERROR")
} else if (result?.isCancelled == true) {
print("CANCELLED")
} else if let result = result {
// Use the BTDropInResult properties to update your UI
// result.paymentOptionType
// result.paymentMethod
// result.paymentIcon
// result.paymentDescription
}
controller.dismiss(animated: true, completion: nil)
}
self.present(dropIn!, animated: true, completion: nil)
}

此实现的问题是我没有全局方法来消除此 View 。然而,文档没有提供不同的实现选项。

最佳答案

好吧,由于没有人回答我的问题,所以我请求了技术支持。他们没有提供很好的解决方案,但更多的是解决问题。此实现修复了它:

self.tabBarController?.present(dropIn!, animated: true, completion: nil)

而不仅仅是

self.present(dropIn!, animated: true, completion: nil)

希望有一天能帮助别人:)

关于ios - 带有 iOS 标签栏 Controller 的 Braintree 嵌入式 UI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49851911/

25 4 0