<EditText
android:id="@+id/edt_order_note_text"
android:layout_width="match_parent"
android:layout_height="90dp"
android:padding="5dp"
android:minLines="5"
android:gravity="top"
android:background="@drawable/order_edt_note_bg"
android:textColor="@color/black"
android:textSize="14sp"/>

EditText的多行输入,涉及到的属性有:

minLines是只输入的最小行数,
gravity="top"是为了让文字从输入框上面依次排版下来,而不是显示在输入框中间。
使用maxLines的EditText最大行数为3行,当输入的内容超过3行后, 它形状的大小不会根据输入内容的多少而改变, 反正它显示的内容就是3行 而使用minLines的EditText是至它至少显示3行内容 (包括内容为空时,可对比图片),当输入的内容超过3行后, 它形状的大小根据输入内容的多少而改变。

@drawable/order_edt_note_bg是一个输入框背景的xml,order_edt_note_bg.xml代码如下:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="6dp" >
</corners>
<stroke
android:width="1dp"
android:color="#c0c0c0" >
</stroke>
</shape>

android---EditText的多行输入框的更多相关文章

  1. Android EditText控件行尾为表情时的BUG

    今天处理项目上的一个诡异BUG,贴吧Android客户端发贴框是支持表情文字混排的,但是当发贴框的行内容末尾为表情时,尝试在表情后插入文字,就悲剧了:文字其实写进去了,但是不会显示出来.研究了一下,发 ...

  2. Android EditText多行显示及所有属性

    android:id="@+id/editSms" android:layout_width="fill_parent" android:layout_heig ...

  3. Android EditText输入格式设置

    在开发的过程中,通常会用到EditText,如何让虚拟键盘来适应输入框中内容的类型,通常我们都会在xml文件中加入android:inputType="". android:inp ...

  4. android EditText inputType说明

    在开发的过程中,通常会用到EditText,如何让虚拟键盘来适应输入框中内容的类型,通常我们都会在xml文件中加入android:inputType="". android:inp ...

  5. android:EditText控件

    EditText 是程序用于和用户进行交互的另一个重要控件,它允许用户在控件里输入和编 辑内容,并可以在程序中对这些内容进行处理.EditText 的应用场景应该算是非常普遍了, 发短信.发微博.聊 ...

  6. android EditText inputType 及 android:imeOptions=”actionDone”

    一.android 软件盘事件响应 在android中,有时需要对EditText实现软件盘监听的场景.当android按下软键盘的时候,响应完成.发送.搜索或者其他事件. Google 提供了 Ed ...

  7. Android EditText属性

    1.EditText输入的文字为密码形式的设置 (1)通过.xml里设置: 把该EditText设为:android:password="true" // 以”.”形式显示文本 ( ...

  8. android EditText中的inputType

    android 1.5以后添加了软件虚拟键盘的功能,所以在输入提示中将会有对应的软键盘模式 android中inputType属性在EditText输入值时启动的虚拟键盘的风格有着重要的作用.这也大大 ...

  9. android EditText与TextView几个常用的属性

    android:maxLength="100"输入框最多输入的字数. android:maxEms="10"每行最多输入字符个数 android:textcol ...

随机推荐

  1. 洛谷 P2590 [ZJOI2008]树的统计

    大家好,我非常喜欢暴力数据结构,于是我用块状树过了这道题目 题目: 一棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w. 我们将以下面的形式来要求你对这棵树完成一些操作: I. CHANGE ...

  2. windows环境下安装composer,然后使用composer安装Laravel

    Composer 不是一个包管理器,它仅仅是一个依赖管理工具,它允许你申明项目所依赖的代码库,并在你的项目中安装这些代码库.它涉及 “packages” 和 “libraries”,但它在每个项目的基 ...

  3. H5_0007:使用base64做为背景图片

    page { overflow:hidden; position:fixed; /* background-image:url('http://p0d5ombx1.bkt.clouddn.com/lo ...

  4. CentOS6和CentOS7

    http://mirrors.aliyun.com/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1708.iso net.ifnames= biosdevname ...

  5. JGUI源码:prefixfree 这个库有时候会引起网页一直加载中(10)

    如题,大部分情况下正常,但是chrome频繁刷新时,会出现这个问题,控制台没有异常信息.最终放弃使用引用第三方库prefixfree.min.js

  6. centos7-aliyun

    # 安装EPEL和IUS软件源 yum install epel-release -y yum install https://centos7.iuscommunity.org/ius-release ...

  7. 20164305 徐广皓 Exp5 MSF基础应用

    一.知识点总结 二.攻击实例 主动攻击的实践 ms08_067(win7) payload/generic/shell_reverse_tcp(失败) payload/windows/meterpre ...

  8. 解决本地SqlServer无法连接远程服务器数据库,错误10060

    本地SqlServer 连不上服务器的数据库环境,错误信息如下图,折腾来折腾去,最终还是解决了 第一步 查看服务器本地端口是否已经打开,查看方法:首先向C:\Windows\System32文件夹添加 ...

  9. pyenv安装及常用命令

    1.pyenv安装 #下载安装脚本curl https://pyenv.run | bash #添加环境变量 echo 'export PATH="/root/.pyenv/bin:$PAT ...

  10. java连接3种数据库 JdbcLinkDB --201801

    先看这篇记录 java连接3种数据库 JdbcLinkDB 测试 --201801 配置文件放在jar外面 读取,遇到的问题 - 海蓝steven - 博客园https://www.cnblogs.c ...