如何在TextView中显示网站的链接,而不是纯文本。
很简单,只需做如下设置
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="all"
android:text="http://www.abc.com"
/>
本文介绍如何在Android的TextView中将网址以链接形式展示而非纯文本,通过设置autoLink属性为all,使得TextView能自动识别并高亮显示URL链接。
如何在TextView中显示网站的链接,而不是纯文本。
很简单,只需做如下设置
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="all"
android:text="http://www.abc.com"
/>
3732

被折叠的 条评论
为什么被折叠?