I would like to know the line number in EditField while I am typing some text in this component.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Get the width of the edit field. (int returned) (e.g. 320 px)
Get the font width of your current text.
Font class have getAdvance() method that accepts the string parameter(int returned) (e.g. 650 px)if string width > edit field widthyou can divide string width and edit width and on the other step get the modulo of it. (here you will get 2 as division and 10 will be yr modulo. That means you have filled two lines + in third line you are having characters that can be fit into 10 px.I hope it will solve your problem, but be careful if you use any long words, the module had never been tested with long words but I fear about result’s accuracy with long words.