【发布时间】:2013-09-15 02:47:55
【问题描述】:
它可能看起来很简单,但我很困在这个问题上,我想在我的应用程序中添加一个超链接例如:www.example of an address with spaces.html
但是当我将 url 放入代码中时,它看起来像这样
这是我的代码
<TextView
android:id="@+id/link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:linksClickable="true"
android:autoLink="web"
android:layout_marginLeft="10dp"
android:textColor="@color/white"
android:text="http://www.example of an address with spaces.html" />
【问题讨论】:
-
不要在 URL 中使用空格。他们不属于那里。但是:在字符串中使用 %20(而不是空格),那么它应该可以工作。
-
我知道,但有没有其他方法可以做到这一点
标签: android html xml hyperlink