問題描述
有人試圖改變浮動(dòng)標(biāo)簽的字體?我改了EditText的來源但是浮動(dòng)標(biāo)簽的字體沒有變,非常感謝幫助我的人
代碼:
.這將設(shè)置展開和浮動(dòng)提示的字體.
這里是 功能請(qǐng)求b.android.com.
錯(cuò)誤視圖字體未設(shè)置,但現(xiàn)在是 已在 v25.1.0
中修復(fù).
Someone tried to change the font of the floating label? I changed the source of EditText but the font of the floating label did not change, I am very grateful to those who help me
Code:
<android.support.design.widget.TextInputLayout
android:id="@+id/tilTextoDescricao"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/tilValorUnidade"
android:layout_marginTop="10dp">
<EditText
android:id="@+id/etTextoDescricao"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:hint="Descri??o"
android:textSize="15dp"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
-----------------
etTextoDescricao= (EditText) findViewById(R.id.etTextoDescricao);
etTextoDescricao.setTypeface(CustomTypeface.getTypefaceMediumDefault(this));
解決方案 As of Design Library v23
, you can use TextInputLayout#setTypeface()
.
This will set the typeface on both the expanded and floating hint.
Here is the feature request where it was discussed on b.android.com.
EDIT: The error view typeface was not being set, but is now fixed in v25.1.0
.
這篇關(guān)于更改浮動(dòng)標(biāo)簽 EditText 和 TextInputLayout 的字體的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!