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

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

问题描述

我有一个 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 text 垂直方向查看文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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