从包装中的Andr​​oid停止对象 [英] Stop objects from wrapping in Android

查看:109
本文介绍了从包装中的Andr​​oid停止对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何prevent一个TextView,或任何可视对象,从包装到屏幕上,而是让他们砍掉了立场?有一些XML属性或code要做到这一点还是无法从屏幕上有什么溢出?

How do I prevent a TextView, or any visual object, from wrapping to the screen and instead have them chopped off the sides? Is there some XML attribute or code to do this or is it impossible to have anything overflow from the screen?

例如,你有这样的:

但你真的想这样的:

任何想法?

推荐答案

先看看安卓SINGLELINE =真正的,如果你想添加结束 ... 还添加安卓ellipsize =结束

check out android:singleLine="true" and if you want to add ending ... add also android:ellipsize="end"

<TextView
   android:id="@+id/name"
   android:text="i want this to crop not wrap"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:singleLine="true"
   android:ellipsize="end" />

这篇关于从包装中的Andr​​oid停止对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆