【问题标题】:AutoCompleteTextView and input type in AndroidAndroid中的AutoCompleteTextView和输入类型
【发布时间】:2013-05-02 06:37:14
【问题描述】:

当我为 AutoCompleteTextView 提供 inputtype 为“TextUri”时,键盘会显示出来,在我点击完成时输入 url 后,它仍然会显示在屏幕上,而不是消失。

要隐藏键盘,我需要按返回键..

    <AutoCompleteTextView android:id="@+id/autocomplete_country"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:inputType="textUri"/>

【问题讨论】:

    标签: android


    【解决方案1】:

    下面链接的答案可能会有所帮助,它基本上说使用这个:

    InputMethodManager inputManager = (InputMethodManager) Context.getSystemService(Context.INPUT_METHOD_SERVICE); 
      inputManager.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
    

    how to hide keyboard after typing in EditText in android?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多