如何在Android中设置TextView以在一行中显示文本 [英] How to set a TextView to display text in one line in Android

查看:1081
本文介绍了如何在Android中设置TextView以在一行中显示文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将TextView设置为显示器.我想在一行中显示正在执行的操作,例如:

I've set a TextView as the display. I want to display the operation being performed in one line, for example:

9856243187 + 2457896123 - 214583

问题是,当输入到达TextView的边缘时,它会跳到下一行.

The problem is, when the input reaches the edge of the TextView - it jumps to the next line.

那么,有什么办法可以避免这种情况,即使输入超出了屏幕,也可以将输入保持在一行中?

So, is there anyway to avoid this behavior and keep the input in one line, even if it goes out of the screen?

推荐答案

您应在TextView标记中使用android:maxLines="1". android:singleLine="true"已被弃用.

You should use android:maxLines="1" in your TextView tag. android:singleLine="true" is deprecated.

这篇关于如何在Android中设置TextView以在一行中显示文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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