android文本查看垂直方向的文本 [英] android text view text in vertical direction

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

问题描述

我有一个 Textview,我在其中显示文本 12345 现在我想显示文本

I have a Textview in which i am showing text 12345 now i want to show text

1
2
3
4
5

我尝试了 rotation,但它旋转了我的文本,并没有给出准确的外观.
我不想在 character 中放置 标签.
我不想定制.

I tried rotation but it rotate my text and not giving the exact look.
I don't want to place tag in character.
I don't want customization.

推荐答案

您可以将 TextView 扩展到您的自定义 VerticalTextView 并覆盖 setText() 方法.在 setText 实现中,您可以遍历文本并修改它插入换行符 .完成后,只需将结果值设置为您的视图.

You could extend TextView to your custom VerticalTextView and override setText() method. In setText implementation you could iterate through text and modify it inserting linebreaks . After you finish just set result value to your view.

这篇关于android文本查看垂直方向的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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