本文介紹了Android - editText 中的默認值的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
在我的應用程序中,我有一個編輯用戶詳細信息頁面,我想在相應的 editText 字段中顯示當前姓名、電子郵件地址等,然后用戶可以刪除它并根據需要輸入一個新的.
In my app I have an edit user details page and I want to display the current name, email address etc in the corresponding editText fields and then the user can just erase that and enter a new one if they want.
有沒有辦法做到這一點?感謝您的幫助
Is there a way to do this? Thanks for any help
推薦答案
可以使用EditText.setText(...)
設置 EditText 字段的當前文本.
You can use EditText.setText(...)
to set the current text of an EditText field.
例子:
yourEditText.setText(currentUserName);
這篇關于Android - editText 中的默認值的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!