gpt4 book ai didi

ios - Stripe iOS 更改后退按钮标题

转载 作者:行者123 更新时间:2023-11-28 05:50:58 25 4
gpt4 key购买 nike

有办法改变 Stripe 取消按钮的标题吗?

Stripe PaymentMethodsController

我需要把它改成“Back”,事实上,“Back”更适合描述它的行为。

我以这种方式呈现 Controller :

let customerContext = STPCustomerContext(keyProvider: StripeClient.shared)
let paymentMethodsViewController = STPPaymentMethodsViewController(configuration: STPPaymentConfiguration.shared(), theme: STPTheme.default(), customerContext: customerContext, delegate: self as STPPaymentMethodsViewControllerDelegate)
let navigationController = UINavigationController(rootViewController: paymentMethodsViewController)
present(navigationController, animated: true)

最佳答案

转到 strip 文件中的 STPCoreViewController.m。

只需替换此方法

- (void)commonInitWithTheme:(STPTheme *)theme {
_theme = theme;

if (![self useSystemBackButton]) {
self.cancelItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
target:self
action:@selector(handleCancelTapped:)];

self.stp_navigationItemProxy.leftBarButtonItem = self.cancelItem;
}
}

- (void)commonInitWithTheme:(STPTheme *)theme {
_theme = theme;

if (![self useSystemBackButton]) {

self.cancelItem = [[UIBarButtonItem alloc]
initWithTitle:@"Back"
style: UIBarButtonItemStylePlain
target:self
action:@selector(handleCancelTapped:)];

self.stp_navigationItemProxy.leftBarButtonItem = self.cancelItem;
}
}

关于ios - Stripe iOS 更改后退按钮标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52981990/

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