[英]Android - Change a layout attribute on a button click
I have a problem here. 我在这里有问题。
I have a large text, that doesn't fit in the screen... So in the layout XML I have put this string: 我有一个大文本,不适合屏幕显示...因此,在布局XML中,我输入了以下字符串:
android:ellipsize="end"
Ok, but now I want to make this TextView clickable and when I click it, I want to change the layout XML code to: 好的,但是现在我想使此TextView可单击,当我单击它时,我想将布局XML代码更改为:
android:ellipsize="marquee"
So the text roll and people will read it. 这样,文本卷就会被人们阅读。
I've searched lots os questions but none has answered that, just for 'drawable' things. 我搜索了很多操作系统问题,但仅针对“可绘制”的东西,没有一个答案。
Thanks! 谢谢!
Use 采用
textView.setEllipsize(TextUtils.TruncateAt.MARQUEE);
on textView Click. 在textView上单击。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.