久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

EditText 的首字母大寫

First letter capitalization for EditText(EditText 的首字母大寫)
本文介紹了EditText 的首字母大寫的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在開發一個小型個人待辦事項列表應用程序,到目前為止一切都運行良好.我想弄清楚一個小怪癖.每當我去添加一個新項目時,我都會有一個對話框,里面顯示一個 EditText 視圖.當我選擇 EditText 視圖時,鍵盤會按原樣輸入文本.在大多數應用程序中,默認值似乎是第一個字母的 shift 鍵......盡管在我看來它并沒有這樣做.必須有一種簡單的方法來修復,但我反復搜索了參考資料,但找不到.我在想適配器加載的引用必須有一個 xml 屬性,但我不知道它是什么.

解決方案

靜態(即在你的布局 XML 文件中):在你的 EditText 上設置 android:inputType="textCapSentences"代碼>.

以編程方式:您必須在 EditTextInputType 中包含 InputType.TYPE_CLASS_TEXT,例如

EditText 編輯器 = new EditText(this);editor.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);

<塊引用>

可以結合文本及其變體來請求每個句子的第一個字符大寫.

- Google 文檔

I'm working on a little personal todo list app and so far everything has been working quite well. There is one little quirk I'd like to figure out. Whenever I go to add a new item, I have a Dialog with an EditText view showing inside. When I select the EditText view, the keyboard comes up to enter text, as it should. In most applications, the default seems to be that the shift key is held for the first letter... although it does not do this for my view. There has to be a simple way to fix, but I've searched the reference repeatedly and cannot find it. I'm thinking there has to be an xml attribute for the reference loaded by the Adapter, but I can't find out what it is.

解決方案

Statically (i.e. in your layout XML file): set android:inputType="textCapSentences" on your EditText.

Programmatically: you have to include InputType.TYPE_CLASS_TEXT in the InputType of the EditText, e.g.

EditText editor = new EditText(this); 
editor.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);

Can be combined with text and its variations to request capitalization of the first character of every sentence.

- Google Docs

這篇關于EditText 的首字母大寫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

EditText: Disable Paste/Replace menu pop-up on Text Selection Handler click event(EditText:禁用文本選擇處理程序單擊事件上的粘貼/替換菜單彈出)
Multiline EditText with Done SoftInput Action Label on 2.3(2.3 上帶有完成 SoftInput 操作標簽的多行 EditText)
How to detect the swipe left or Right in Android?(如何在 Android 中檢測向左或向右滑動?)
Prevent dialog dismissal on screen rotation in Android(防止在Android中的屏幕旋轉對話框解除)
How do I handle ImeOptions#39; done button click?(如何處理 ImeOptions 的完成按鈕點擊?)
How do you set EditText to only accept numeric values in Android?(您如何將 EditText 設置為僅接受 Android 中的數值?)
主站蜘蛛池模板: 色网站入口 | 夜夜精品浪潮av一区二区三区 | 日本成人综合 | 不卡一区二区三区四区 | 久久午夜视频 | 91精品国产91综合久久蜜臀 | 亚洲视频在线观看 | 欧洲一区二区三区 | 日韩欧美一区二区三区免费观看 | 蜜臀久久99精品久久久久野外 | 久久99视频精品 | www.蜜桃av | 欧美成人精品一区 | 91亚洲国产成人精品一区二三 | 激情一区二区三区 | 久久精品国产免费一区二区三区 | 日一日操一操 | 国产一区二区久久 | 99在线视频观看 | 精品久久久网站 | 作爱视频免费观看 | 国产精品久久毛片av大全日韩 | 99reav| 超碰97av| 久久久久国产精品一区三寸 | 日韩在线播放第一页 | 国产成人99久久亚洲综合精品 | 亚洲国产中文字幕 | 男人天堂网址 | 另类专区亚洲 | 免费黄篇 | 成人黄色在线视频 | 精品视频一区二区三区 | 99视频久| 色婷婷亚洲一区二区三区 | 午夜视频一区二区 | 一区二区久久电影 | 二区在线观看 | 欧美阿v| 毛片在线免费 | 99精品网|