What is the best way to enter numeric values with decimal points?

前端 未结 11 1848
粉色の甜心
粉色の甜心 2020-11-27 11:25

In my app users need to be able to enter numeric values with decimal places. The iPhone doesn\'t provides a keyboard that\'s specific for this purpose - only a number pad an

11条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 12:13

    You can use STATextField and set currencyRepresentation to YES which:

    Ensures no more than one decimal point is entered and that no more than 2 digits are entered to the right of said decimal point.

    There's also STAATMTextField which supports currency mode and ATM text entry by default:

    Provides a text field that mimics ATM machine input behavior.

提交回复
热议问题