我認爲你可以在兩種不同的顏色和文本的線性佈局中使用兩個textview。然後你可以實現onClicklistener()
兩個文本視圖。你會達到你想要的,看起來和你所期望的一樣。
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
<TextView
android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@+id/settings"
android:layout_marginTop = "10dip"
android:padding="3dip"
android:text="@string/txt1"
android:textColor="#000000"
android:textSize="25sp"
android:textStyle="bold" />
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@+id/settings"
android:layout_marginTop = "10dip"
android:padding="3dip"
android:text="@string/txt2"
android:textColor="#1569C7"
android:textSize="25sp"
android:textStyle="bold" />
</LinearLayout>
希望它可以幫助
有沒有簡單的解決方案。如果您使用的是TextView而不是WebView,那麼您需要先確定點擊點的座標(onClickListener在這裏可能沒有幫助 - 您需要使用Touch事件),並確定文本在文本視圖。 – 2012-07-10 08:07:00