chronotruck / FlagPhoneNumber

A formatted phone number UITextField with country flag picker.
Apache License 2.0
437 stars 318 forks source link

UiTextfield border Style selected as none then there is no spacing between phone code and input phone number #126

Open JobLess-Engineer opened 4 years ago

JobLess-Engineer commented 4 years ago

Describe the bug UiTextfield border Style selected as none then there is no spacing between phone code and input phone number.

To Reproduce Steps to reproduce the behavior:

  1. Go to Xcode Project and put UITextField on storyboard and set up border style none in IB or textfieldName.borderStyle = .none.
  2. Add the FPN pods and run project.
  3. see the error.

Expected behavior It would be nice if there is space between phone code and phone number. The issue arrises only when border style = none is selected.

Screenshots Screenshot 2019-09-27 at 1 19 43 PM

Smartphone (please complete the following information):

dustfire commented 4 years ago

Hey I had the same issue.. did this to fix it temp:

        textField.leftView?.translatesAutoresizingMaskIntoConstraints = false
        textField.leftView?.widthAnchor.constraint(equalToConstant: 110.0).isActive = true

apparently in iOS13 right/left views dimensions needs to be set via constraints.

JobLess-Engineer commented 4 years ago

Nope that didn't work for me @dustfire. Screenshot 2019-10-03 at 4 49 07 PM

Temporarily fixed it by setting border style to line and then hiding the borders using UIViews.

Ganeshya17 commented 4 years ago

I am also facing the same issue.. can any one fix it?

summonerriftofficial commented 3 years ago

same