how to hide/unhide the actionbar list on android 3?

后端 未结 1 1752
鱼传尺愫
鱼传尺愫 2021-01-16 10:52

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

相关标签:
1条回答
  • 2021-01-16 11:24

    Thanks to this https://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;
                }
            });
    
    0 讨论(0)
提交回复
热议问题