TextView组件

TextView :

Android:autoLink

layout文件中的String.xml文件的内容是:

<stringname="webUrl">凤凰网:http://www.ifeng.com</string>

<stringname="email">小强的邮箱:sss@111.com</string>

<stringname="phoneNumber">电话号码:1333333335</string>

<stringname="mapUrl">620EighthAvenueNewYork,NY10018\n

</string>

<stringname="autoAll">

凤凰网:http://www.ifeng.com小强的邮箱:sss@111.com电话号码:1333333335

</string>

layout文件中建一个auto_link布局文件:

<TextView

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:autoLink="web"

android:text="@string/webUrl"/>

<TextView

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:autoLink="email"

android:text="@string/email"/>

<TextView

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:autoLink="phone"

android:text="@string/phoneNumber"/>

<TextView

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:autoLink="map"

android:text="@string/mapUrl"/>

<TextView

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:autoLink="all"

android:text="@string/autoAll"/>

<TextView

android:id="@+id/tvHtml"

android:layout_width="fill_parent"

android:layout_height="wrap_content"/>

显示效果为:

带边框的TextView

java文件中新建一个MyBorderTextView文件:

layout文件中新建一个border_tv文件:

实现的效果图为:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值