<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"
/>
这里主要是这两个属性:
android:layout_height="wrap_content"
android:minLines="3"
还有就是 edittext的父控件的高度 也要设置成包裹类型
<LinearLayout
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="52dp"
android:layout_marginRight="10dp"
android:gravity="center_vertical"
android:orientation="horizontal" >
<TextView
android:gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp
android:text="详细地址:"
android:textColor="#4A4A4A"
android:textSize="14sp" />
<EditText
android:layout_marginTop="3dp"
android:layout_marginBottom="3dp"
android:minLines="1"
android:gravity="center_vertical"
android:id="@+id/et_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@null"
android:textColor="#000000"
android:textSize="13sp" />
</LinearLayout>
<script type="text/javascript">
$(function () {
$('pre.prettyprint code').each(function () {
var lines = $(this).text().split('\n').length;
var $numbering = $('<ul/>').addClass('pre-numbering').hide();
$(this).addClass('has-numbering').parent().append($numbering);
for (i = 1; i <= lines; i++) {
$numbering.append($('<li/>').text(i));
};
$numbering.fadeIn(1700);
});
});
</script>
分享到:
相关推荐
你要是用自动换行,你在手机上看代码着实很累了,所有输入框必须实现不自动换行的功能,并且文本内容可以随手指滚动,但是问题来了,我在网上找了半天,也没找到具体怎么实现的,我还浪费了时间和金钱,所以借这个...
酷炫动画,edittext文字飞入效果
edittext输入超过长度自动缩小文字大小并动态记录可输入文字
Android EditText悬浮文字提示
代码为EditText悬浮文字提示的实例代码,有问题请博客留言:http://blog.csdn.net/seven2729/article/details/48655807
实现 EditText 输入文字之后格式正确性认证功能.rar,太多无法一一验证是否可用,程序如果跑不起来需要自调,部分代码功能进行参考学习。
EditText定义样式,限制输入字符,自动换行,获取焦点
listView实现文字编辑的自动换行.
输入框文字大小随长度变化 Edittext 和 TextView 文字大小随长度变化而变化 自定义输入框和文本框
EditText中输入表情和文字,仿照扣扣表情
edittext输入图片和文字;图片经过压缩、缩小
EditText和Textview的部分文字响应
自定义固定头文字的多行文本编辑框.rar,太多无法一一验证是否可用,程序如果跑不起来需要自调,部分代码功能进行参考学习。
相应的文字变化,适用于搜索引擎下listview有相同的String,对应的文字,起颜色变化,颜色可以自己选择
根据微信使用EditText 发送表情!
一个基于Android原生的EditText的富文本组件,支持文字输入,可以插入图片
主要介绍了Android EditText随输入法一起移动并悬浮在输入法之上,本文通过示例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
本文主要介绍了Android中使用EditText控制禁止输入空格和回车的实现代码。具有很好的参考价值。下面跟着小编一起来看下吧
该控件可使EditText上方出现悬浮的提示文字,需要配合EditText使用。控件需要依赖:NineOldAndroids包项目地址:https://github.com/wrapp/floatlabelededittext 效果图:如何使用使用非常简单,只需要将EditText...
edittext图文混合编辑,使图片可以和文字一样便利的编辑