android text 在垂直方向查看文本
我有一个 Textview
,其中显示文本 12345
现在我想显示文本
1
2
3
4
5
我尝试了旋转
,但它旋转了我的文本并且没有给出确切的外观。
我不想在 character
中放置 \n 标记。
我不想定制。
I have a Textview
in which i am showing text 12345
now i want to show text
1
2
3
4
5
I tried rotation
but it rotate my text and not giving the exact look.
I don't want to place \n tag in character
.
I don't want customization.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
您可以将
TextView
扩展为自定义VerticalTextView
并重写setText()
方法。在setText
实现中,您可以迭代文本并通过插入换行符\n
来修改它。完成后,只需将结果值设置为您的视图即可。You could extend
TextView
to your customVerticalTextView
and overridesetText()
method. InsetText
implementation you could iterate through text and modify it inserting linebreaks\n
. After you finish just set result value to your view.