android.widget.SearchView.setInputType()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中android.widget.SearchView.setInputType()方法的一些代码示例,展示了SearchView.setInputType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SearchView.setInputType()方法的具体详情如下:
包路径:android.widget.SearchView
类名称:SearchView
方法名:setInputType

SearchView.setInputType介绍

暂无

代码示例

代码示例来源:origin: kingargyle/adt-leanback-support

public static void setInputType(View searchView, int inputType) {
    ((SearchView) searchView).setInputType(inputType);
  }
}

代码示例来源:origin: stackoverflow.com

SearchView searchView = new SearchView(getContext());
searchView.setInputType(InputType.TYPE_CLASS_NUMBER);

代码示例来源:origin: stackoverflow.com

SearchView searchView = new SearchView(getContext());
searchView.setInputType(InputType.TYPE_CLASS_TEXT);
searchView.setBackgroundColor(Color.WHITE);

代码示例来源:origin: stackoverflow.com

@Override
public boolean onCreateOptionsMenu(Menu menu) {
  MenuInflater menuInflater = getMenuInflater();
  menuInflater.inflate(R.menu.default_menu, menu);

  if (MyApplication.SUPPORTS_HONEYCOMB) { // quick check for API level
    // If we have the honeycomb API, set up the search view
    MenuItem searchItem = menu.findItem(R.id.search);

    SearchView search = (SearchView) searchItem.getActionView();

    // your code here.  something like:
    search.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_NORMAL);

    // you also likely want to set up your search listener here.

  }

  // I'm using ActionBarCompat, in which case
  // calling super after populating the menu is necessary here to ensure that the
  // action bar helpers have a chance to handle this event.
  return super.onCreateOptionsMenu(menu);
}

代码示例来源:origin: stackoverflow.com

searchView = (SearchView) actionSearch.getActionView();
searchView.setQueryHint(Constants.USER_HINT);
searchView.setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS);
searchView.setOnQueryTextListener(onQueryTextListener);
return true;

代码示例来源:origin: stackoverflow.com

SearchView searchViewTemp = (SearchView) v;
    int inType = searchViewTemp.getInputType();         //backup the input type
    searchViewTemp.setInputType(InputType.TYPE_NULL);   //Disable standard keyboard
    searchViewTemp.onTouchEvent(event);
    searchViewTemp.setInputType(inType);
    return true;
searchView.setInputType(searchView.getInputType() | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);

代码示例来源:origin: Yaerin/XposedHider

getMenuInflater().inflate(R.menu.main, menu);
SearchView sv = (SearchView) menu.findItem(R.id.menu_search).getActionView();
sv.setInputType(EditorInfo.TYPE_CLASS_TEXT);
sv.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

相关文章