我有一個長文本消息,後面跟着一個鏈接,並把它放在TextView中。它就像這樣:TextView在使用linkify或自動鏈接後突出顯示
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<LinearLayout android:orientation="vertical"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:id="@+id/details" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:padding="10dp"
android:text="@string/message" android:textSize="16sp" android:autoLink="web"/>
</LinearLayout>![alt text][1]
</ScrollView>
問題是當我選擇鏈接時,整個文本變得突出顯示。這怎麼能被阻止?
只是爲了澄清我用linkify來做到這一點,那沒有奏效。我甚至嘗試設置一個自定義正則表達式來解析文本的一部分,但這並沒有奏效。 – sazwqa 2010-10-06 19:37:49
也許只是一個模擬器問題?你在真實設備上試過了嗎? – ShadowGod 2010-10-07 09:20:20
是的,我做過了,我也看到這也發生在股票API演示中。奇怪的是,我的行爲看起來很奇怪。肯定有解決辦法,但我只想知道如果我在這裏失去了一些東西。 – sazwqa 2010-10-07 18:13:40