Android自定義view---VerticalTextView
VerticalTextView
Android 垂直TextView(Vertical TextView),文字垂直顯示文字
Github 原始碼: VerticalTextView
Demo

demo.gif
gradle
implementation "com.sjtu.yifei:vertical-textview:1.4.0"
引數說明
引數 | 型別 | 說明 |
---|---|---|
text | string&reference | 文字 |
textColor | color&reference | 字型顏色 |
textSize | dimension&reference | 字型大小 |
rowSpacing | dimension&reference | 行間距 |
columnSpacing | dimension&reference | 列間距 |
columnLength | integer | 一列文字的長度,建議使用該屬性來限制高度 |
maxColumns | integer | 最大限制的列數,超出的部分使用縱向省略號 |
atMostHeight | boolean | 預設true,使用確定高度值時,會對縱向尾部不夠文字多出的空白會自動去掉,使用時如果強制顯示這種空白需要設定為false |
isCharCenter | boolean | 預設true,true表示文字使用Paint.Align.CENTER ,false表示文字使用Paint.Align.LEFT |
textStyle | 列舉0/1/2 | normal/bold/italic |