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标签高度增加,从而导致整个页面内容的不协调:
随机推荐
- ifreq、ifconf
网络相关的ioctl请求的request参数及arg地址必须指向的数据类型如下表所示: 接口 SIOCGIFCONF SIOCSIFADDR SIOCGIFADDR SIOCSIFBRDADDR SI ...
- Spring Cloud学习笔记【五】Hystrix Dashboard监控面板
ystrix除了隔离依赖服务的调用以外,Hystrix 还提供了准实时的调用监控(Hystrix Dashboard),Hystrix 会持续地记录所有通过 Hystrix 发起的请求的执行信息,并以 ...
- Win8.1应用开发之文件操作
在操作文件之前,先相应用的应用功能声明进行设定.用户通过C#(非UI)对win8.1上的文件进行訪问,仅仅能局限于图片,音乐,视频和文档四个目录. 而通过文件选取器则能訪问到整个系统的文件. (一)应 ...
- CXF实战之在Tomcat中公布Web Service(二)
服务接口及实现类请參考WebService框架CXF实战(一) 创建Maven Web项目,在pom.xml中加入CXF和Spring Web的引用,因为CXFServlet须要Spring Web的 ...
- 在Qt 4.4中,Alien Widget诞生了(Window负责与窗口系统的联系。Alien被号称是所有闪烁的终结者)
2011年09月29日 23:47:46 阅读数:7269 Qt 4.0 automatically double-buffers Qt 4.1 QWidget::autoFillBackground ...
- 通过视频展示如何通过Samba配置PDC
通过视频展示如何通过Samba配置PDC(Linux企业应用案例精解补充视频内容) 本文通过视频,真实地再现了在Linux平台下如何通过配置smb.conf文件而实现Samba Server模拟win ...
- 浅谈 C 语言中模块化设计的范式
今天继续谈模块化的问题.这个想慢慢写成个系列,但是不一定连续写.基本是想起来了,就整理点思路出来.主要还是为以后集中整理做点铺垫. 我们都知道,层次分明的代码最容易维护.你可以轻易的换掉某个层次上的某 ...
- C++中冒号(:)的作用
摘于:http://blog.csdn.net/zimingjushi/article/details/6549390 (1)表示机构内位域的定义(即该变量占几个bit空间) typedef stru ...
- Convolution & Pooling exercise
convolution First, we want to compute σ(Wx(r,c) + b) for all valid (r,c) (valid meaning that the ent ...
- [Chromium文档转载,第007章]JNI on Chromium for Android
Overview JNI (Java Native Interface) is the mechanism that enables Java code to call native function ...