安卓:当文本是使文本字幕比TextView的短 [英] Android: enabling text marquee when text is shorter than textview

查看:170
本文介绍了安卓:当文本是使文本字幕比TextView的短的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法使文本滚动字幕文本时比短TextView的?

Is there any way to enable text marquee when text is shorter than textview?

推荐答案

在设置TextView的的elipsize属性在XML文件中框选

Set the elipsize property in TextView to marquee in the xml file

安卓ellipsize =金字招牌

android:ellipsize="marquee"

,然后在您的活动onCreate方法创建TextView的对象和setSelectedProperty设置为true

and then create an object for the TextView in your onCreate method of your activity and set the setSelectedProperty to true

textview1.setSelected(真)

textview1.setSelected(true)

来源:previous StackOverflow的答案

这篇关于安卓:当文本是使文本字幕比TextView的短的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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