禁用自动换行在Android多行的TextView [英] Disable Word Wrap in an Android Multi-Line TextView

查看:1707
本文介绍了禁用自动换行在Android多行的TextView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作了一个月查看了先进的刷卡(需要电流,下一个和previous加载,让每个视图坚持你的手指),这意味着我有很多意见,导致事情要一点点有点慢。

I am working on a Month View with an advanced swipe (requires current, next and previous to be loaded to allow each view to stick to your finger) which means I have many views which causes things to be a little bit slow.

            |          | #<-- screen bounderies
 ' previous ' current  '   next   ' #<-- three months loaded
    ' previous ' current  '   next   ' #<-- three months when the user drags their finger

由于这一点,我想重新present多个事件在一个单一的TextView的。当用户点击月视图(小屏幕)的日子之一,它会打开日视图的那一天。

Because of this I want to represent multiple events in a single TextView. When the user taps one of the days on the Month View (small screen), it will open the day view for that day.

在每一天在月视图(通常是一天获取屏幕宽度的七分之一和不到七分之一垂直)我想避免这种

On each day in the month view (typically a single day gets one seventh of the width of the screen and a little less than one seventh vertically) I would like to avoid this

|    31|
|10a:  |
| Testi|
|ng    |
|11a:  |

相反,我想

|    31|
|10a:  |
| Testi|
|11a:  |
| Anoth|

请注意,纳克被切断而不是换到下一行了。这是我所期待的。

Notice that the ng is cut off instead of wrapping to the next line. This is what I am looking for.

推荐答案

在Java的:

setHorizontallyScrolling(boolean) 

在理论上,机器人:scrollHorizo​​ntally应XML做同样的,但有是停止它的工作在Android中的错误

In theory, android:scrollHorizontally should do the same in XML, but there is a bug in android that stops it working.

这篇关于禁用自动换行在Android多行的TextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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