<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. Spring学习详解(1)——Spring入门详解

    一:spring的基本用法: 1,关于spring容器: spring容器是Spring的核心,该 容器负责管理spring中的java组件, ApplicationContext ctx  = ne ...

  2. SharePoint Search之(五)Query spelling correction— 查询拼写纠正

     Query spelling correction 在使用搜索引擎的时候.假设一不小心输入错误,或者对于某个词语记得不太清楚,搜索引擎会自己主动纠正: 这个功能可以缩短用户的时间,很好用.在Sh ...

  3. 20.发送http请求服务 ($http)

    转自:https://www.cnblogs.com/best/tag/Angular/ 服务从代码直接与服务器进行交互,底层是通过实现,与中http服务从AngularJS代码直接与Web服务器进行 ...

  4. 流量数据iftop命令

    yum install flex byacc libpcap ncurses ncurses-devel libpcap-devel tar zxvf iftop-0.17.tar.gz cd ift ...

  5. 生成不重复的随机数对(C/C++)

    1 #include <stdio.h> #include <algorithm> #include <stdlib.h> #include <time.h& ...

  6. 实时监控Cat之旅~分布式消息树的实现原理与测试

    大众点评的老吴在InfoQ上讲了Cat之后,有不少同仁开始关注这个实时监控系统,但学习的文章甚少,在GitHub上也是一言代过,给我们这些开发人员留下了N多个疑问,一时间不知道去哪里问,向谁去问了,通 ...

  7. codeforces 701 B. Cells Not Under Attack

    B. Cells Not Under Attack time limit per test 2 seconds memory limit per test 256 megabytes input st ...

  8. Linux常用图片查看处理软件

    1.Shotwell是一款轻量级的图片管理软件,GNOME桌面环境默认自带,您可以使用它来从数码相机中导入相片.shotwell允许用户对图片进行管理,并且提供了一些基本的编辑功能,您可以对图片进行剪 ...

  9. Fedora27 安装Adobe Flash Player PPAPI与NPAPI实现Firefox和Chromium视频播放

    一.Adobe Flash Player PPAPI与NPAPI有什么区别我们在打开网页视频时有时会弹出没有安装Flash插件的提示,此时就无法观看视频.Adobe Flash Player是浏览器显 ...

  10. 03015_DBUtils

    1.概述 (1)如果只使用JDBC进行开发,我们会发现冗余代码过多,为了简化JDBC开发,本案例我们讲采用apache commons组件一个成员:DBUtils : (2)DBUtils就是JDBC ...