的Android的TextView我有一個顯示一個TextView 電話:0900-1111,傳真:0900-2222帶有可點擊電話號碼
有沒有一種方法,使手機點擊,但沒有傳真。
使用
Phone: <a href="tel:09001111">0900-1111</a>, Fax: 0900-2222
隨着自動鏈接設置爲手機,都是可點擊的!
的Android的TextView我有一個顯示一個TextView 電話:0900-1111,傳真:0900-2222帶有可點擊電話號碼
有沒有一種方法,使手機點擊,但沒有傳真。
使用
Phone: <a href="tel:09001111">0900-1111</a>, Fax: 0900-2222
隨着自動鏈接設置爲手機,都是可點擊的!
你檢查了API演示嗎?
他們有一個樣本就是爲此,在Views/Text/Linkify下。
類位於com.example.android.apis.text.Link.java
例如用於那裏的的TextView之一的字符串是:
<string name="link_text_manual"><b>text2: Explicit links using <a> markup.</b>
This has markup for a <a href="http://www.google.com">link</a> specified
via an <a> tag. Use a \"tel:\" URL
to <a href="tel:4155551212">dial a phone number</a>.
</string>
和TextView的是:
<TextView android:id="@+id/text2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/link_text_manual"
/>
我使用,但我有2個鏈接,而不是隻有一個指定的錨定標籤... – user2052680
我不明白。你能不能展示你想要的東西,以及你試圖做什麼?那裏的樣本有很多不同的鏈接,都是可定製的,可以打開/關閉。 –
電話:0900-1111,傳真:0900-2222 ...我希望傳真號碼不可點擊。我嘗試過或沒有href = tel,但它們始終都是可點擊的。 – user2052680
爲什麼這甚至關閉和downvoted這麼多?這是一個很好的問題,有一個很好的答案。 – Muz
1853次觀看1年。不是一個壞的問題,我認爲 – alternatiph
我覺得這是一個很好的問題? – Zapnologica