版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34433038/article/details/78261571
TextView一行最多显示8个 其他的字符自动滚动
实现效果
代码实现
<TextView
android:id="@+id/dw_jianchadanwei"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:ellipsize="marquee"
android:focusable="true"
android:maxEms="8"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:paddingBottom="10.0dip"
android:paddingLeft="2.0dip"
android:paddingTop="10.0dip"
android:scrollHorizontally="true"
android:singleLine="true"
android:textColor="#ff000000"
android:textSize="@dimen/content" />