• ActionBar


     actionLayout:使用

     app:actionLayout="@layout/action_layout_view"
     View edit_view=menuItem_edit.getActionView();
    

    actionProvider:使用

            app:actionProviderClass="android.support.v7.widget.ShareActionProvider"
            ShareActionProvider shareActionProvider= (ShareActionProvider) MenuItemCompat.getActionProvider(menuItem_refactor);
            shareActionProvider.setShareIntent(this.getDefaultIntent());
    	
    private Intent getDefaultIntent() { Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_TEXT,""); //intent.setType("image/*"); return intent; }

    选项卡模式的ActionBar的使用

     actionBar = getSupportActionBar();
             actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    	 ActionBar.Tab tab1= actionBar.newTab();
    	 tab1.setIcon(R.drawable.abc_ic_commit_search_api_mtrl_alpha);
             tab1.setText("TAB1");
             tab1.setTabListener(this);
             actionBar.addTab(tab1);
    	
             fragment = new BlankFragment();
             Bundle bundle = new Bundle();
             bundle.putString("content",tab.getText().toString());
             fragment.setArguments(bundle);
             ft.replace(R.id.linear,fragment);
    

    列表模式的ActionBar的使用

    ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,data);
    	actionBar.setListNavigationCallbacks(adapter, new ActionBar.OnNavigationListener() {}
    

      

  • 相关阅读:
    简单的总结
    /bin/bash: sshpass: command not found
    ubuntu 16.04 忘记root密码
    ubuntu下QtCreator启动无响应问题解决
    TX1 文字界面启动与root用户自动登录设置
    qt线程睡眠
    TX2 默认root用户启动
    linux下使用文件IO监听GPIO中断
    Linux下指定线程的名字
    [Error] ISO C++ forbids comparison between pointer and integer
  • 原文地址:https://www.cnblogs.com/qcgAd/p/5123269.html
Copyright © 2020-2023  润新知