项目中遇到需要textview内容竖着排的需求,如图所示:

android中TextView内容竖向显示

网上那些“教程”并不能达到需要的效果,发现有一个属性可以支持这种效果,android:ems=“*”,这是属性表示一行只显示*个字符。

具体代码如下:

1 <TextView
2                 android:layout_centerInParent="true"
3                 android:id="@+id/leaderName"
4                 android:layout_width="wrap_content"
5                 android:layout_height="wrap_content"
6                 android:textSize="22sp"
7                 android:ems="1"
8                 android:textColor="@color/white" />

 

相关文章:

  • 2021-07-28
  • 2021-12-20
  • 2021-11-30
  • 2021-10-14
  • 2021-11-29
  • 2021-04-05
  • 2021-09-20
  • 2021-11-03
猜你喜欢
  • 2017-12-01
  • 2021-10-02
  • 2021-08-16
  • 2021-11-16
  • 2021-04-14
  • 2022-01-16
  • 2021-11-22
  • 2021-11-23
相关资源
相似解决方案