有没有什么办法来解决每行的字符中的一个EditText量没有这样做编程? [英] Is there any way to fix the amount of characters per line in an EditText without doing it programatically?

查看:111
本文介绍了有没有什么办法来解决每行的字符中的一个EditText量没有这样做编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想设置每行的字符的最大数量,这样的话会换到下一行。有没有办法做到这一点?我查了一下的EditText文档和我没有看到这样的一条明路。

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.

任何帮助是pciated AP $ P $

Any help is appreciated

推荐答案

您可以设置

android:maxWidth="200dip"

里面的的EditText您的XML文件。这将使它自动换行到下一行一次的宽度为止。你必须用浸价值发挥就看你有多大希望。据我所知是没有办法来衡量,虽然这在字符。你需要有layout_height设置为WRAP_CONTENT另外,如果你想视图将增长到显示文本,因为它被类型化,如果不是你的看法更长的时间。

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.

这篇关于有没有什么办法来解决每行的字符中的一个EditText量没有这样做编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆