Numeric keyboard with decimal

前端 未结 4 1897
刺人心
刺人心 2021-01-03 19:13

I´m building an app with equations and I have used a numeric keyboard but I want to have a decimal slot on it. The default is only numbers. How do you add a decimal input on

相关标签:
4条回答
  • 2021-01-03 19:45

    In storyboard go to Attribute Inspector. There you can change keyboard type.You can check here

    0 讨论(0)
  • 2021-01-03 19:56

    set keyboard type to textField in swift 3

    @IBOutlet weak var txtNumber: UITextField!  
    
    override func viewDidLoad(){
    
        self.txtNumber.keyboardType = .decimalPad
    }
    
    0 讨论(0)
  • 2021-01-03 20:00

    Select Decimal Pad in Keyboard Type for Text Field in Attribute Inspector.

    Refer the image below for more detail

    0 讨论(0)
  • 2021-01-03 20:01

    Simply change the keyboard type:

    self.someTextField.keyboardType = UIKeyboardType.decimalPad
    

    See the documentation for all the keyboard types.

    0 讨论(0)
提交回复
热议问题