我使用的Android 3.0动作条带有下拉和searchWidget。
我想,当用户展开搜索,以隐藏下拉和取消隐藏下拉当用户关闭搜索。
下面是图片说明bettere
和这里是$ C $词的使用,使下拉
动作条酒吧= this.getActionBar();
bar.setTitle(this.getString(R.string.app_name));
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
...
ListDittaListener监听器=新ListDittaListener(本);
bar.setListNavigationCallbacks(seleziona_ditta,监听器);
解决方案
由于这种 http://stackoverflow.com/a/五十七万九千六百四十六分之六百四十五万四千二百八十八
searchView.setOnSearchClickListener(新OnClickListener(){
@覆盖
公共无效的onClick(视图v){
Log.v(MyApp.TAG,搜索视图在搜索点击);
动作条酒吧= FattureActivity.this.getActionBar();
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
}
});
searchView.setOnCloseListener(新OnCloseListener(){
@覆盖
公共布尔的OnClose(){
Log.v(MyApp.TAG,搜索视图在关闭);
动作条酒吧= FattureActivity.this.getActionBar();
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
返回false;
}
});
i am using android 3.0 actionbar with a dropdown and a searchWidget.
I would like to hide the dropdown when the user expands the search and unhide the dropdown when the user closes the search.
Here is a picture to explain bettere
and here is the code i use to make the dropdown
ActionBar bar = this.getActionBar();
bar.setTitle(this.getString(R.string.app_name));
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
...
ListDittaListener listener = new ListDittaListener(this);
bar.setListNavigationCallbacks( seleziona_ditta, listener);
解决方案
Thanks to this http://stackoverflow.com/a/6454288/579646
searchView.setOnSearchClickListener( new OnClickListener() {
@Override
public void onClick(View v) {
Log.v(MyApp.TAG, "search view On Search Click");
ActionBar bar = FattureActivity.this.getActionBar();
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
}
});
searchView.setOnCloseListener( new OnCloseListener() {
@Override
public boolean onClose() {
Log.v(MyApp.TAG, "search view On Close");
ActionBar bar = FattureActivity.this.getActionBar();
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
return false;
}
});
上一篇:大厦离子应用为Android在Linux上失败,退出code 2:无法找到'ANDROID_HOME“离子、大厦、Android、Linux
下一篇:如何使用PhoneGap的,Facebook的插件CLI 5.2 / PGB下如何使用、插件、PhoneGap、PGB