本文整理了Java中android.widget.SearchView.onActionViewExpanded()
方法的一些代码示例,展示了SearchView.onActionViewExpanded()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SearchView.onActionViewExpanded()
方法的具体详情如下:
包路径:android.widget.SearchView
类名称:SearchView
方法名:onActionViewExpanded
暂无
代码示例来源:origin: stackoverflow.com
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
SearchView searchView = (SearchView) toolbar.findViewById(R.id.searchView);
searchView.onActionViewExpanded(); // Expands searchView by default
// If this is not set, then you will see default search icon and you have to click it to expand SearchView.
代码示例来源:origin: stackoverflow.com
toolbar2.inflateMenu(R.menu.search2);
SearchView searchViewBottom = (SearchView)findViewById(R.id.search_bottom);
searchViewBottom.onActionViewExpanded();
代码示例来源:origin: stackoverflow.com
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.sample_actions, menu);
SearchView searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.action_search));
searchView.setOnQueryTextListener(this);
searchView.onActionViewExpanded();
return super.onCreateOptionsMenu(menu);
}
代码示例来源:origin: stackoverflow.com
SearchView searchView = (SearchView) findViewById(R.id.searchView);
searchView.onActionViewExpanded();
searchView.setIconified(true);
代码示例来源:origin: JBossOutreach/lead-management-android
SearchView searchView = (SearchView) searchMenuItem.getActionView();
searchView.setQueryHint(getString(R.string.search));
searchView.onActionViewExpanded();
searchView.clearFocus();
searchView.setSubmitButtonEnabled(false);
代码示例来源:origin: ValueYouth/RhymeMusic
private void initComponents()
{
application = (MusicApplication) getApplication();
/*搜索结果为空时,显示的提示信息*/
textTips = (TextView) findViewById(R.id.text_tips);
/*按钮类组件初始化*/
searchBack = (ImageButton) findViewById(R.id.image_search_back);
searchOption = (ImageButton) findViewById(R.id.image_search_option);
searchBack.setOnClickListener(this);
searchOption.setOnClickListener(this);
/*列表组件初始化*/
listView = (ListView) findViewById(R.id.list_search_result);
listView.setOnItemClickListener(this);
listView.setVisibility(View.INVISIBLE);
loadData();
/*搜索组件初始化*/
searchView = (SearchView) findViewById(R.id.view_search);
searchView.setOnQueryTextListener(this);
searchView.onActionViewExpanded(); // 默认出现点击输入状态
searchView.setFocusable(false);
searchView.clearFocus();
// searchView.setSubmitButtonEnabled(true);
}
内容来源于网络,如有侵权,请联系作者删除!