問題描述
這將有一個非常簡單的答案,但我似乎無法找到它是什么.我想禁用 EditText 的自動大寫,以便默認情況下輸入的第一個字母不會自動大寫.我仍然希望允許大寫,但前提是用戶手動這樣做.
This will have a really simple answer, but I can't seem to find what it is. I want to disable the auto-capitalization of an EditText so that, by default, the first letter entered with not be automatically capitalized. I still want to allow capitalization, but only if the user manually does so.
我已經在我的 EditText 上嘗試了 android:capitalize="none"
,并且我已經嘗試了 android:inputType="text"
但兩者仍然是自動大寫的第一個字母.我不想使用 TextWatcher
因為在軟鍵盤上它仍然會顯示按下第一個字母的 shift 鍵,而且我很挑剔,不希望顯示.
I've tried android:capitalize="none"
on my EditText, and I've tried android:inputType="text"
but both still auto-capitalize the first letter. I don't want to use a TextWatcher
because on the soft keyboard it will still show the shift key as pressed for the first letter, and I'm nit-picky and don't want that to show.
推薦答案
你可以嘗試使用 android:inputType="none"
代替.
You could try using android:inputType="none"
instead.
更新:
您也可以嘗試使用 android:inputType="text|textEmailAddress"
這篇關于如何禁用 EditText 的自動大寫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!