zoukankan      html  css  js  c++  java
  • Android EditText控件即设置最小高度又运行高度随内容增加而变化

    (转)http://www.aichengxu.com/view/1405748   记录学习用

    如题,有时候EditText需要一个最小的高度,但是在输入更多内容时,要随着内容的增加而变化高度,一般都是增加。这时我们可以利用EditText的minLines属性。

    即最小行数,只要我们指定了minLines属性,同时将layout_height 设置为wrap_content ,即可实现我们的目的。

    <EditText
    android:id="@id/shareadd_content"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="left|top" android:hint="@string/input_share_content" android:textColor="@color/gay_33" android:minLines="3" android:background="@drawable/bg_newsdetail_edit" />
  • 相关阅读:
    style实例
    背景小实例
    html表单与输入实例
    列表小知识
    表格的使用
    框架的奥秘
    链接那档子事
    判断网络是否连通
    Python3编码规范
    CentOS 7 安装 Docker-Compose
  • 原文地址:https://www.cnblogs.com/woaixingxing/p/5529602.html
Copyright © 2011-2022 走看看