完椭圆问题TextViews [英] End the ellipse problem with TextViews

查看:165
本文介绍了完椭圆问题TextViews的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哇SDK,哇...

所以我试图椭圆添加到我的TextView(单线)结束它运行了屏幕前。我读过椭圆破产了(开发2.1)?谷歌搜索后,每个人都似乎在暗示设置inputType文字和MAXLINES 1,你会得到一个椭圆形。

So I'm attempting to add an ellipse to the end of my TextView (single line) before it runs off screen. I've read that ellipses are broke (developing for 2.1)? After Google searching, everyone seems to suggest setting inputType to text and maxLines to 1 and you will get an ellipse.

有两个问题: 1)文本跑出画面,但是不椭圆。我可以告诉文本运行关闭屏幕因为一个字符只有一半被示出在屏幕的边缘,但它不是打印...来代替。 2)当我有inputType设置我的TextView,点击我的列表项不再起作用!没有突出显示,当您点击和onListItemClick处理程序不火!

There are two problems with this: 1) The text runs off the screen, but doesn't ellipse. I can tell the text is running off the screen because only a half of a character is showing at the edge of the screen, but it's not printing "..." instead. 2) When I have inputType set on my TextView, clicking my list item no longer works! There is no highlighting when you click and the onListItemClick handler does not fire!

所以...

我能做些什么吗?

我想指出,有两种方式可以椭圆。如果整个词不适合在屏幕上,隐藏整个单词,并添加一个椭圆形。或者,只是脱下足够的字符,以便椭圆适合。理想的情况是,后者是我想要的。

I would like to note that there are two ways one could ellipse. If the entire word does not fit on the screen, hide the entire word and add an ellipse. Or, just take off enough characters so an ellipse will fit. Ideally, the latter is what I want.

感谢您的帮助

推荐答案

如果你想ellipsize,简单地使用机器人:单线=真,或Android:ellipsize =结束

If you want to ellipsize, simply use android:singleLine="true", or android:ellipsize="end".

这篇关于完椭圆问题TextViews的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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