I can not adjust the edittext linespacing

大憨熊 提交于 2019-12-08 08:57:33

问题


I want to adjust the line spacing of edittext. I use a long line, and when I cross the line, linespacing is applied. However, linespacing does not apply when I input Enter key.


回答1:


This Library fixed the EditText linespacing issue https://github.com/hanks-zyh/LineHeightEditText




回答2:


use this code for line space between two line

 android:lineSpacingExtra="10dp"

whole code is

      <EditText
            android:id="@+id/edittext"
            android:layout_margin="@dimen/activity_horizontal_margin"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:lineSpacingExtra="10dp" //set the line space between 2 lines
            android:text="iadhadhsfbsfffbdgfddgdfdjkfhdjfhdkfhdfhdfhdkfhdkjhfkdhfdkhfdkfhdhfdkfhdkhfdjkfhdfhd"/>


来源:https://stackoverflow.com/questions/42687621/i-can-not-adjust-the-edittext-linespacing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!