簡體   English   中英

如何在Android中為同一TextView設置自定義字體和文本顏色

[英]How to set both custom font and textcolor for a same textview in android

我在Google中搜索了很多東西,但是我可以在textview中發送一種自定義字體或文本,但是我想在同一個textview中設置兩者,可以有人幫我這個問題嗎?

<TextView
android:id="@+id/pleaseRead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pleasereadthis" />*

您可以使用lib @ https://github.com/chrisjenx/Calligraphy ,它提供了廣泛的字體功能。

其他創建字體如下

 Typeface t = createFromAsset(AssetManager mgr, String path)

接着

textview.setTypeface(t)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM