I am beginner to xamarin studio.i have one edittext. I have added that edittext dynamically.i want to that edittext allows only number and decimal point.How to do validation??
I need this kind of validation by IP addresses. It allows only decimal numbers and point. I validated it with contrains the keyboard. In the XML i setted two parameter:
<item name="android:inputType">numberDecimal</item> <item name="android:digits">.0123456789</item>
It is from style but i think you understand this. In code i found the following possibility:
EditText et = new EditText (); et.InputType = Android.Text.InputTypes.NumberFlagDecimal; et.SetOnKeyListener(DigitsKeyListener.GetInstance(".0123456789"));
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies