gpt4 book ai didi

ios - 并非所有 Stripe 占位符同时在我的屏幕上可见

转载 作者:行者123 更新时间:2023-11-29 05:51:17 25 4
gpt4 key购买 nike

您好,我尝试在屏幕上同时显示所有三个占位符,在更改 strip 付款文本字段名称中的占位符名称后STPPaymentCardTextField

我在 Storyboard中给占位符命名,如下所示

enter image description here

但是当我在模拟器中运行程序时,我得到以下输出:

enter image description here

当我尝试输入在文本字段中选择的详细信息时,只有它会显示占位符,例如

enter image description here

我想显示 4242424242424242 的占位符卡号替换如何解决此问题。

  @IBOutlet weak var cardview: STPPaymentCardTextField!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
cardview.numberPlaceholder = "CardNumber"
cardview.cvcPlaceholder = "CVC"
cardview.expirationPlaceholder = "MM/YY"
}*

最佳答案

首先,您不需要在 Storyboard 或 viewDidLoad 中设置 MM/YY 和 CVC 的自定义占位符,因为它们已经是默认占位符,请参阅 STPPaymentCardTextField.h 上的代码引用:

/**
The placeholder for the expiration field. Defaults to @"MM/YY".
*/
@property (nonatomic, copy, nullable) IBInspectable NSString *expirationPlaceholder;

/**
The placeholder for the cvc field. Defaults to @"CVC".
*/
@property (nonatomic, copy, nullable) IBInspectable NSString *cvcPlaceholder;

关于您无法在一个屏幕中直接看到所有三个占位符的问题,如 from the authors :

This is intentional. If you type a valid credit card number into the CC field, it will slide away to reveal the expiration and CVC fields.

在较大的屏幕(例如处于横向模式的 iPad)中,这三个屏幕通常同时可见,因为它们可以一起显示在屏幕中。

关于ios - 并非所有 Stripe 占位符同时在我的屏幕上可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55651060/

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