W3Cschool
恭喜您成為首批注冊(cè)用戶(hù)
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
public static interface Text.TextObserver
提供一個(gè)文本觀(guān)察器來(lái)觀(guān)察組件中的文本變化。
每次文本更改時(shí)都會(huì)調(diào)用此類(lèi)中的 onTextUpdated(java.lang.String, int, int, int) 方法。
修飾符和類(lèi)型 | 方法 | 描述 |
---|---|---|
void | onTextUpdated(String text, int start, int before, int count) | 文本更改時(shí)回調(diào)。 |
void onTextUpdated(String text, int start, int before, int count)
文本更改時(shí)回調(diào)。
該方法用于處理變化的文本,例如驗(yàn)證輸入的LOV得到LOVE,其中text為L(zhǎng)OVE,start為3,before為3,count為1。
參數(shù):
參數(shù)名稱(chēng) | 參數(shù)描述 |
---|---|
text | 表示當(dāng)前文本。 |
start | 指示要添加的文本的起始位置。 |
before | 表示舊文本的長(zhǎng)度。 |
count | 表示要添加的文本的長(zhǎng)度。 |
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話(huà):173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: