GithubHelp home page GithubHelp logo

Comments (13)

NikKovIos avatar NikKovIos commented on June 7, 2024

@tjsingh04 Did you check the example project?

from nkvphonepicker.

tjsingh04 avatar tjsingh04 commented on June 7, 2024

yes i was checked , i think the problem is pre fill text of country code in the textfield, when i remove country code then it show the placeholder but i need it even if country code is there.

from nkvphonepicker.

NikKovIos avatar NikKovIos commented on June 7, 2024

Place your code or project here.

from nkvphonepicker.

tjsingh04 avatar tjsingh04 commented on June 7, 2024

set NKVPhonePickerTextField directly from storyboard and create its outlet shown as below

@IBOutlet weak var phoneTF: NKVPhonePickerTextField!

and in viewDidLoad is have use below code

    phoneTF.phonePickerDelegate = self
    phoneTF.placeholder = "Phone Number"
    phoneTF.flagInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 0)
    phoneTF.layer.cornerRadius = 10

from nkvphonepicker.

tjsingh04 avatar tjsingh04 commented on June 7, 2024

you can also check in your sample project as well. placeholder only shows when remove country code from it. but i need it with country code if you can help.
here are the screenshoots

Simulator Screen Shot - iPhone Xʀ - 2019-05-09 at 12 30 54
Simulator Screen Shot - iPhone Xʀ - 2019-05-09 at 12 31 01

from nkvphonepicker.

NikKovIos avatar NikKovIos commented on June 7, 2024

Hmm, the plus is too close to flag also. What phone model is it?
Fix your message markdown pls.

from nkvphonepicker.

tjsingh04 avatar tjsingh04 commented on June 7, 2024

plus is closed, becoz of flagInsets i think and phone model is iphone XR 12.2 version

from nkvphonepicker.

NikKovIos avatar NikKovIos commented on June 7, 2024

Sorry, but the textField is using a standard placeholder and i don't see how to easily change its behaviour.

However you can set a little hack like:

textField.countryPickerDelegate = self

extension ViewController: CountriesViewControllerDelegate {
    func countriesViewController(_ sender: CountriesViewController, didSelectCountry country: Country) {
        print("✳️ Did select country: \(country)")
        textField.placeholder = country.phoneExtension
    }
}

Also tell what you exactly want to achieve?

from nkvphonepicker.

tjsingh04 avatar tjsingh04 commented on June 7, 2024

i just want to show place holder just like my second screenshoot, but it only show when i remove whole text from textfield i.e when remove country code, means place holder is not shown with country code added in textfield as you see in first screenshoot , it shows when i remove country code (refer to 2nd screenshoot).

i want to show place holder with country code added in textfield. now do you get my point?

from nkvphonepicker.

NikKovIos avatar NikKovIos commented on June 7, 2024

from nkvphonepicker.

tjsingh04 avatar tjsingh04 commented on June 7, 2024

yes i think so, is there any other hack for it

from nkvphonepicker.

NikKovIos avatar NikKovIos commented on June 7, 2024

from nkvphonepicker.

tjsingh04 avatar tjsingh04 commented on June 7, 2024

okay Thanks Brother

from nkvphonepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.