开发者

Clamping values in preference screen

Is there a way to clamp the numeri开发者_JAVA技巧cal value entered into a editTextPreference? I'd like to limit a value to say +- 45.


In addition to setting android:inputType="numberSigned", you would need to setup a KeyListener, or TextWatcher, to enforce the min/max values.

Alternatively, you may want to look into one of the existing views that are intended for this type of limited input, such as NumberPicker

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜