草庐IT

PKPaymentButton

全部标签

iOS Apple Pay - 自定义 PKPaymentButton

我正在使用PKPaymentButton进行ApplePay集成,但想知道我是否可以轻松自定义它。letapplePayButton=PKPaymentButton(type:PKPaymentButtonType.setUp,style:PKPaymentButtonStyle.black)我们可以更改按钮样式吗?设置ApplePay后,我想将buttonType更改为.buy但没有找到解决方案。我们可以去掉圆角半径吗?默认ApplePay按钮具有圆角半径。我不喜欢它并试图将其删除。因此,我尝试使用图层,但没有成功。applePayButton.layer.cornerRadius=

ios - 如何在 IB 中创建 PKPaymentButton?

以下代码来自WWDC2015Session702ApplePayWithinApps-Emporium:使用ApplePay的简单购物体验ifPKPaymentAuthorizationViewController.canMakePaymentsUsingNetworks(ProductTableViewController.supportedNetworks){letbutton=PKPaymentButton(type:.Buy,style:.Black)button.addTarget(self,action:#selector(ProductTableViewControlle