This is a B4xlib customview that uses a textfield, label and the textformatter lib to provide formatting of a numeric text field with NumberFormat2.
Once the textfield loses focus, the number is displayed with formatting defined in the custom view by overlaying a label.
Click on the label to edit the text, you can also programmatically get and set the value using the B4xNFinput.text methods.
The customview uses a layout so you can change it as you like if you unpack the lib.
The number format is modifiable in the designer on the customview but requires delimiting with a semicolon ";" rather than the number formats comma ",".
Depends On:
Once the textfield loses focus, the number is displayed with formatting defined in the custom view by overlaying a label.
Click on the label to edit the text, you can also programmatically get and set the value using the B4xNFinput.text methods.
The customview uses a layout so you can change it as you like if you unpack the lib.
The number format is modifiable in the designer on the customview but requires delimiting with a semicolon ";" rather than the number formats comma ",".
Depends On:
JavaObject
Usage:
Download the B4xNFInput b4xlib and TextFormatter B4xlib and save them with your B4xLibs.
Add the custom view to your layout.
Define the format in the designer customview entry.
The demo in the zip file is a simple example.
Please test and let me know of any problems. Feel free to unpack the library and make any changes you require.
Attachments
Last edited: