android - How to set maxLength in Anko -


i have been trying set maxlength edittext in anko unable find right function.

 edittext()         {             id = r.id.et2             hint = "age"             inputtype = android.text.inputtype.type_class_number             maxlines = 1         }.lparams {             below(r.id.et1)             alignparentleft()             leftof(r.id.bt1)         } 

you can use maxlength property

 edittext()             {                 id = r.id.et2                 hint = "age"                 inputtype = android.text.inputtype.type_class_number                 maxlines= 1                 maxlength = 10             }.lparams {                 below(r.id.et1)                 alignparentleft()                 leftof(r.id.bt1)             } 

refer documentation : anko attributes


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -