如何隐藏/取消隐藏在Android 3的动作条列表?动作、列表、Android

2023-09-06 23:57:45 作者:三岁就很酷

我使用的Andr​​oid 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,监听器);
 
3Dmax中取消隐藏对象栏里的对象都没了是什么情况,求高手指点

解决方案

由于这种 http://stackoverflow.com/a/五十七万九千六百四十六分之六百四十五万四千二百八十八

  searchView.setOnSearchClickListener(新OnClickListener(){

            @覆盖
            公共无效的onClick(视图v){
                Log.v(MyApp.TAG,搜索视图在搜索点击);


                动作条酒吧= FattureActivity.this.getActionBar();
                bar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
            }
        });



        sea​​rchView.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;
            }
        });