TextView- 内容过长省略号设定
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/iconlist"
<TextView android:id="@+id/date"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize= "12sp"
android:textColor="@color/dlg_text_counter_color"
android:layout_marginLeft="6dp"
android:gravity="center_vertical" />
</LinearLayout>
<LinearLayout
android:id="@+id/content"
android:layout_alignParentTop="true"
android:layout_marginTop="10dip"
android:layout_toLeftOf="@id/iconlist"
android:gravity="center_vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView android:id="@+id/fullintegrationmode"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:visibility="gone"/>
<TextView android:id="@+id/from"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:singleLine="true"
android:layout_marginRight="6dip"
android:ellipsize="middle" />
<TextView android:id="@+id/unread"
android:background="@drawable/ipmsg_message_box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="12sp"
android:textColor="@color/text_color_unread"
android:singleLine="true" />
</LinearLayout>
问题:当TextView from 文字过长的时候,会跟 TextView date发生重叠
解决方法:只要添加一个属性android:layout_toLeftOf="@id/iconlist" 就可以了,因为这能保证它不会超越iconlist 的控件位置
补充:textview省略的四种形式
1.android:ellipsize=”start”—–省略号显示在开头
2.android:ellipsize=”end”——省略号显示在结尾
3.android:ellipsize=”middle”—-省略号显示在中间
TextView- 内容过长省略号设定的更多相关文章
- Android TextView内容过长加省略号,点击显示全部内容
在Android TextView中有个内容过长加省略号的属性,即ellipsize,用法如下: 在xml中:android:ellipsize="end" 省略号在结尾an ...
- Android中TextView内容过长加省略号
textview中有个内容过长加省略号的属性,即ellipsize,用法如下: 在xml中 Android:ellipsize = "end" 省略号在结尾 and ...
- Android TextView内容过长加省略号
在Android TextView中有个内容过长加省略号的属性,即ellipsize,用法如下: 在xml中: android:ellipsize = "end" //省略号在结尾 ...
- table中td内容过长 省略号显示
首先设置 css样式: table { table-layout: fixed;} HTML中的table代码: <tr> <th class="col-md-1" ...
- table:设置边距,td内容过长用省略号代替
table:设置边距,td内容过长用省略号代替 1.table:设置边距 合并表格边框border-collapse: collapse,然后用th,td的padding设置内容和边框之间的空隙pad ...
- [Web 前端] td长度固定,内容过长,超过部分用省略号代替
cp from : https://blog.csdn.net/bsh_csn/article/details/51829103 html的table表格中td长度固定,当内容过长时,超过部分用省略号 ...
- css内容过长显示省略号的几种解决方法
单行文本(方法一): 语法: text-overflow : clip | ellipsis 参数: clip : 不显示省略标记(...),而是简单的裁切 (clip这个参数是不常用的!) elli ...
- django2.1---后台管理 admin 字段内容过长,省略号替代
用django admin做后台的时候, 有些字段内容太长,像文章,长评论,新闻等可以限制显示长度,超出部分用...代替 1.在model.py中 def short_content(self): i ...
- td标签内的内容过长导致的问题的解决办法
问题描述:在开发过程中,td标签中的有一个cell格中的内容过长,导致td标签高度增加,从而导致整个页面内容的不协调:
随机推荐
- windows server 打开 FTP 服务器上的文件夹时发生错误。请检查是否有权限访问该文件夹。
解决方案1: 打开高级安全windows防火墙,设置出入站规则. 然后,再打开windows防火墙界面,点击左上角“允许程序或功能通过windows防火墙”,勾选上设置的出入站名称和FTP服务器. 如 ...
- android 推断是否支持闪光灯
近期在做录制视频功能,在找一些资料时发现 要推断是否支持闪关灯,在这记录下来,怕以后忘记 public static boolean isSupportCameraLedFlash(PackageMa ...
- CSS 相对/绝对(relative/absolute)定位与jQuery的控制显示隐藏
曾经写显示隐藏老是用jq方法控制: dom.show(); dom.hide(); 事实上这样还是有非常多缺陷的. 这是html结构: <div class="holi"&g ...
- 基于CANopen DSP402的运动控制笔记
常用的mode of operation 有以下几种: 控制字 control word: 6--------------7---------------15--------------------7 ...
- vsphere平台windows虚拟机克隆的小插曲(无法登陆系统)
问题: 1.克隆完windows虚拟化后输入法乱码. 2.开启远程的情况下远程登录输入正确的密码也无法登录. 解决: 1.更改管理员用户密码(不输入原win7密码更改win7密码). 2.重新启用管理 ...
- C/C++(C++返回对象与应用区别,类成员的存储)
返回对象与应用区别: 拷贝构造器发生的时机: 1.构造新对象 A a, A b = a; 2.传参或返回对象 对于普通变量来说,传引用效果不是很明显,对于类对象而言,传对象效果很高. 传引用等价于扩大 ...
- 【Swift初见】Swift数组(二)
在苹果的开发文档中对Array还提供了其它的操作算法: 1.Sort函数: 对数组进行排序.依据指定的排序规则,看以下的代码: var array = [2, 3, 4, 5] array.sort{ ...
- 关于mysql数据库在输入password后,滴的一声直接退出界面的解决的方法(具体办法)
前一阵子.因为敲代码要用到数据库,便在本子上下载了一个,却出现非常多小问题(自己的台式机却没有该问题,可能是本人的本子太渣了吧),纠结了好一阵,回头想想.发现问题,分析问题,解决这个问题,不就是我们的 ...
- 算法题:给你一个自然数N,求[6, N]之内的全部素数中, 两两之和为偶数的那些偶数。
/* 算法题:给你一个自然数N,求[6, N]之内的全部素数中. 两两之和为偶数的那些偶数. */ #include <iostream> using namespace std; voi ...
- webgoat 7.1 实战指南
WSASP中文文档参考链接: http://www.owasp.org.cn/owasp-project/2017-owasp-top-10 OWASP Top 10 2017中文版V1.3http: ...