我是靠谱客的博主 甜蜜牛排,这篇文章主要介绍AndroidTextView实现文字竖直显示,现在分享给大家,希望可以做个参考。

想要实现的效果这里写图片描述

1. 原生TextView

android:ems=”1” 设置每行只显示1个字符

优点: 使用简单,稳定

缺点:对于数字和字母支持不好。无法显示多行竖直显示.

<TextView
android:id="@+id/tv_station_name"
style="@style/text_color_normal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:ems="1"
android:text="老年活动中心"
android:textSize="13sp"/>

2.使用自定义的VerticalTextView

优点: 支持多行,对字符支持好
缺点:没找到一个支持完美的库….

https://github.com/79144876/TextViewVertical
写的比较差的一个库,不支持sp设置大小,不支持xml设置字体颜色,内容等。有时间再写一个吧。。

最后

以上就是甜蜜牛排最近收集整理的关于AndroidTextView实现文字竖直显示的全部内容,更多相关AndroidTextView实现文字竖直显示内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(53)

评论列表共有 0 条评论

立即
投稿
返回
顶部