AbdelrhmanKamalEliwa/AEOTPTextField

SwiftUI AEOTPView Default Color

waqar681 opened this issue · 4 comments

Hi,
Default Border color not appearing when view show a initially
after when i click then they show me the default border color , But our Requirements is to show the the Border color when they load with out on click field
Please fix This

Please ensure that you use the right property for the default border color. if you still face this issue, kindly attach a screenshot of how you use it.

@AbdelrhmanKamalEliwa Actually, the default border color is not working

The default border color is not working. In my case, I have to type something to appear border color. Has anybody solved this issue?

                        AEOTPView(text: $otp,
                                  height: 60,
                                  //otpBackgroundColor: .clear,
                                  //otpFilledBackgroundColor: .clear,
                                  otpDefaultBorderColor: UIColorConstants.border,
                                  otpFilledBorderColor: UIColorConstants.border,
                                  otpDefaultBorderWidth: 1,
                                  otpFilledBorderWidth: 1,
                                  otpFont: UIFontConstants.SSPSemiBold.size16,
                                  enableClearOTP: false)

I have made a fix on the createLabel method that works for me. Added label.layer.borderColor = otpDefaultBorderColor.cgColor in the method.

func createLabel() -> UILabel { let label = UILabel() label.backgroundColor = otpBackgroundColor label.layer.cornerRadius = otpCornerRaduis label.layer.borderWidth = otpDefaultBorderWidth label.layer.borderColor = otpDefaultBorderColor.cgColor label.translatesAutoresizingMaskIntoConstraints = false label.textAlignment = .center label.textColor = otpTextColor label.font = label.font.withSize(otpFontSize) label.font = otpFont label.isUserInteractionEnabled = true label.layer.masksToBounds = true label.text = otpDefaultCharacter return label }