問題描述
我不確定我是否為這個 UI 功能使用了正確的詞,但我附上了我希望在我的應用中實現的目標的快照.
I am not sure I am using the right words for this UI feature, but I have attached a snapshot of what I am looking to achieve in my app.
Go SMS 使用它,用戶在編輯文本中鍵入聯系人,在用戶從完成下拉列表中選擇聯系人后,聯系人將插入到編輯文本中,如附圖所示.編輯文本是仍然開放以接受進一步的輸入.
Its used by Go SMS, where a user types contacts in an edit text, after the user selects a contact from the completion drop down, the contact is inserted in the edit text as show in the attached image.The edit text is still open to accept further input.
對于我的應用程序,我想在用戶輸入逗號后立即進行分組和插入,就像 StackOverflow 的標簽輸入一樣(但我相信我可以單獨處理.)我的問題是什么樣的查看是這個還是我如何修改 EditText 以使其具有這樣的行為?
For my app, I would like to do the grouping and insertion as soon as the user enters a comma, Just like the Tag input for StackOverflow works (But I believe I can handle that alone.) My problem is what kind of View is this or how do I modify an EditText to behave like this?
謝謝.
推薦答案
Google 的官方 Chips 庫(用于 Gmail、電子郵件、日歷、消息)位于 https://android.googlesource.com/platform/frameworks/opt/chips/
The official Chips library from Google (as used in Gmail, Email, Calendar, Messaging) is located at https://android.googlesource.com/platform/frameworks/opt/chips/
如何使用它的簡單示例可以在 https://code.google.com/p/platform-features-talk-io-2013/source/browse/src/com/example/iotalk/ChipsActivity.java
A simple example of how to use it can be found at https://code.google.com/p/platform-features-talk-io-2013/source/browse/src/com/example/iotalk/ChipsActivity.java
這篇關于帶有芯片的 Android AutoCompleteTextView的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!