Difference between MultiAutoCompleteTextView and AutoCompleteTextView

前端 未结 4 925
情深已故
情深已故 2021-02-01 12:20

Can someone explain the difference between MultiAutoCompleteTextView and AutoCompleteTextView?

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-01 12:52

    The choice between using the AutoCompleteTextView or the MultiAutoCompleteTextView comes down to whether or not the user should be allowed to input only "one item" as provided by the adapter, or "multiple items."

    So for example, if you were writing an email app, and you wanted the "To:" field to be an autocomplete field, pulling matches from an address book, chances are you want to allow the user to pick multiple recipients for a message, and would make this field a MultiAutoCompleteTextView.

    On the other hand, the "From:" field in the same example email app, you would need to enforce only a single selection by the user from their configured email accounts. And so an AutoCompleteTextView would be appropriate here.

提交回复
热议问题