<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- 内容过长省略号设定的更多相关文章

  1. Android TextView内容过长加省略号,点击显示全部内容

    在Android TextView中有个内容过长加省略号的属性,即ellipsize,用法如下: 在xml中:android:ellipsize="end"    省略号在结尾an ...

  2. Android中TextView内容过长加省略号

          textview中有个内容过长加省略号的属性,即ellipsize,用法如下: 在xml中 Android:ellipsize = "end"   省略号在结尾 and ...

  3. Android TextView内容过长加省略号

    在Android TextView中有个内容过长加省略号的属性,即ellipsize,用法如下: 在xml中: android:ellipsize = "end" //省略号在结尾 ...

  4. table中td内容过长 省略号显示

    首先设置 css样式: table { table-layout: fixed;} HTML中的table代码: <tr> <th class="col-md-1" ...

  5. table:设置边距,td内容过长用省略号代替

    table:设置边距,td内容过长用省略号代替 1.table:设置边距 合并表格边框border-collapse: collapse,然后用th,td的padding设置内容和边框之间的空隙pad ...

  6. [Web 前端] td长度固定,内容过长,超过部分用省略号代替

    cp from : https://blog.csdn.net/bsh_csn/article/details/51829103 html的table表格中td长度固定,当内容过长时,超过部分用省略号 ...

  7. css内容过长显示省略号的几种解决方法

    单行文本(方法一): 语法: text-overflow : clip | ellipsis 参数: clip : 不显示省略标记(...),而是简单的裁切 (clip这个参数是不常用的!) elli ...

  8. django2.1---后台管理 admin 字段内容过长,省略号替代

    用django admin做后台的时候, 有些字段内容太长,像文章,长评论,新闻等可以限制显示长度,超出部分用...代替 1.在model.py中 def short_content(self): i ...

  9. td标签内的内容过长导致的问题的解决办法

    问题描述:在开发过程中,td标签中的有一个cell格中的内容过长,导致td标签高度增加,从而导致整个页面内容的不协调:

随机推荐

  1. NYOJ_77 开灯问题

    题目地址 分析: 用一个数组来保存每盏灯的操作的次数.推断奇偶就可以推断灯的状态. 最后的输出格式须要注意一下空格的位置,思路就是现输出一个.剩下来的输出在前面加一个空格. 空格用_表示: 1_3_5 ...

  2. Raphaeljs入门到精通(一)

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <t ...

  3. POJ2369 Permutations【置换群】

    题目链接: http://poj.org/problem?id=2369 题目大意: 给定一个序列.问最少须要多少次置换才干变为 1.2.-.N 的有序序列.比方说给 定5个数的序列 4 1 5 2 ...

  4. HDOJ 5098 Smart Software Installer 拓扑排序

    拓扑排序: 两个队列,一个放不须要重新启动入度为0的,一个放须要重新启动入度为0的....从不须要重新启动的队列開始,每弹出一个数就更新下入度,遇到入读为0的就增加到对应队列里,当队列空时,记录重新启 ...

  5. vue2.0 vue-loader

    vue-cli npm install 脚手架: vue-loader 1.0 -> new Vue({ el: '#app', components:{App} }) 2.0-> new ...

  6. docker 笔记1

    如果想要删除所有container的话再加一个指令: docker stop $(docker ps -a -q) 如果想要删除所有container的话再加一个指令: docker rm $(doc ...

  7. springmvc使用jQuery.datatable时遇到的错误

    springmvc使用jQuery.datatable时遇到的错误 1正确时返回 josn结果: {,,,,,,,,,,,,,,,,"} 页面显示处理中(processing),列表空白,其 ...

  8. 织梦DedeCMS判断简略标题为空时则显示完整标题

    使用织梦DedeCMS系统程序开发网站中,我们会遇到很多因网页版面设计限定的宽度,使文章标题需要进行字数限制,通常做法是在a标签中加入一个title属性,让鼠标放上去的时候显示完整标题.但是标题被剪裁 ...

  9. 关于echarts3版本里的tree图形显示Bug、无法缩放和移动

    在使用echarts3版本的js绘制tree图表的时候,如果想动态更新tree的数据,可能会出现图表渲染有异常,并且api给出的roam配置无法控制图表通过鼠标缩放和移动,如下图: 不过更改echar ...

  10. 参考学习《Python学习手册(第4版)》高清中文PDF+高清英文PDF+源代码

    看到第38章了,整体感觉解释详细,例子丰富:关于Python语言本身的讲解全面详尽而又循序渐进不断重复,同时详述语言现象背后的机制和原理:除语言本身,还包含编程实践和设计以及高级主题.边看边写代码.不 ...