Using countrypickerview ,I want to display only the phonecode not the flag in the left side of text field

1.3k views Asked by At

By default this library displays country flag, country code and phone code . I was able to remove the country code but not the flag .

Let cpv = CountryPickerview(frame: CGRect(x: 0, y: 0,width: 120,height:20))
UserNumber.leftView =cpv
UserNumber.leftView =.always
cpv.showCountryCodeInView = false
1

There are 1 answers

0
Chitra On

Create an IBOutlet from storybaord, set width of the view equal to 50:

@IBOutlet weak var vwCountryPicker: CountryPickerView!

and set following values:

    vwCountryPicker.flagSpacingInView = -30
    vwCountryPicker.flagImageView.isHidden = true