TextView初识

来源:互联网 发布:足球大师卡卡捏脸数据 编辑:程序博客网 时间:2024/05/19 09:16

textView实现文字无线滚动(横向)

android:ellipsize="marquee"android:focusable="true"android:focusableInTouchMode="true"android:marqueeRepeatLimit="marquee_forever"
   <!--ellipsize start middle end 省略号位置前中后-->

把焦点设置在textview上,然后
android:marqueeRepeatLimit 设置为 marquee_forever
就可以实现无限滚动
如果想设置滚动具体次数,给marqueeRepeatLimit 赋相应的值就可以
这里写图片描述


TextView 的AutoLink
textView 的快速链接功能,可以链接网址和电话

<TextView        android:layout_height="wrap_content"        android:layout_width="wrap_content"        android:text="我们网址是 www.baidu.com"        android:autoLink="web"        />    <TextView        android:layout_height="wrap_content"        android:layout_width="wrap_content"        android:text="我们的电话15289472613"        android:autoLink="phone"        android:textColorLink="#00cacb"        />    <TextView        android:layout_height="wrap_content"        android:layout_width="wrap_content"        android:text="562602349@qq.com"        android:autoLink="email"        />    <TextView        android:layout_height="wrap_content"        android:layout_width="wrap_content"        android:text="西安"        android:autoLink="map"        />

link的内容会变颜色
可以设置textColorLink
这里写图片描述

用测试机的话网址,电话,邮箱都可以用使用也比较方便