Is there any way to fix the amount of characters per line in an EditText without doing it programatically?
I just want to set the maximum amount of characters per line, so that the words will wrap onto the next line. Is there any way to do this? I looked over the EditText documentation and I don't see a clear way of doing this.
开发者_JS百科Any help is appreciated
You can set
android:maxWidth="200dip"
Inside your xml file for the EditText. This will make it wrap the text on to the next line once the width is reached. You'll have to play with the dip value to see how big you want it. As far as I know there is no way to measure this in characters though. You'll need to have the layout_height set to "wrap_content" also if you want the view to grow to show the text as it gets typed, if its longer than your view.
you can set maxlength property of edittext
in our xml.
精彩评论