android text 在垂直方向查看文本

发布于 2024-12-22 15:04:03 字数 216 浏览 3 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡水深流 2024-12-29 15:04:03

您可以将 TextView 扩展为自定义 VerticalTextView 并重写 setText() 方法。在 setText 实现中,您可以迭代文本并通过插入换行符 \n 来修改它。完成后,只需将结果值设置为您的视图即可。

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 \n. After you finish just set result value to your view.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文