“setSupportActionBar(toolbar)” inside FragmentActivity?

后端 未结 9 2120
被撕碎了的回忆
被撕碎了的回忆 2021-02-03 18:02

How do I access setSupportActionBar(Toolbar toolbar) inside FragmentActivity? I can\'t access it inside FragmentActivity

t         


        
9条回答
  •  温柔的废话
    2021-02-03 18:34

    For FragmenrtActivity, you should look into FragmentTabHost, and to add tabs simply:

    tab = (FragmentTabHost)findViewById(android.R.id.tabhost);
    tab.setup(this, getSupportFragmentManager(), android.R.id.tabcontent);
    tab.addTab(tabs.newTabSpec("tab1").setIndicator("TAB1"), tab1.class, null);
    

提交回复
热议问题