【周末分享】解决中文排版错位的JustifiedTextview控件

时间:2022-04-27
本文章向大家介绍【周末分享】解决中文排版错位的JustifiedTextview控件,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

1、FlowingDrawer 效果


2、Justifiedtextview 说明


android中textview在中文排版时会出现无法左右对齐,导致界面参吃不齐。justifiedtextview 自定义实现ondraw方法,自己绘制文字。里面还有个控件,两个scrollview联动滚动。

温馨提示:帝都雾霾天又来了,明天上班注意防护哦!

3、Justifiedtextview 使用


下面几个步骤,请仔细阅读。

1、

compile 'me.biubiubiu.justifytext:library:1.1'

2、


<dependency>
<groupId>me.biubiubiu.justifytext</groupId>
<artifactId>library</artifactId>
<version>1.1</version>
<type>aar</type>
</dependency>

3、

<me.biubiubiu.justifytext.library.JustifyTextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>

4、Justifiedtextview 下载

原文链接:https://github.com/ufo22940268/android-justifiedtextview