Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
Cambiar el tipo de teclado de un campo de texto en Swift durante el tiempo de ejecución

Me preguntaba si hay alguna manera de verificar si un campo de texto contiene un carácter determinado y, si ese es el caso, cambiar el tipo de teclado que se muestra. Esto es lo que he probado pero no consigue cambiar. Esta acción ocurre cuando se cambia la edición del campo de texto.

 @IBAction func decOrNot(_ sender: Any) { let cont = "1" let field = testKaede.text if (field!.contains(cont)) { self.testKaede.keyboardType = UIKeyboardType.numberPad } else { self.testKaede.keyboardType = UIKeyboardType.decimalPad } }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Simplemente llame a reloadInputViews() en su UITextField después de cambiar el tipo de teclado


 textField.keyboardType = .numberPad textField.reloadInputViews()
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!