Android limit EditText integer and scale filters (detailed)

A filter is written to limit the integers and decimal places of EditText input as needed, as shown in the following code:

The logic is to judge whether the incoming isjpy needs two decimal places and three decimal places, and then limit the input data. Just add the filter to the corresponding EditText control, as follows: stopedittext. Setfilters (New inputfilter [] {new componentdigitctrlfilter (digit = = 2, digit)});

The above Android limit EditText integer and decimal filter (detailed explanation) is all the content shared by Xiaobian. I hope it can give you a reference and support more programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>