-2
标题基本上说了一切。我想删除此:如何从我的Android应用程序中删除工具栏?
从我的应用程序。我正在使用选项卡式活动。
我已经尝试过的事情:
我想在我的onCreate()方法使用getActionBar.hide()
,我试图改变应用程序的风格/主题我的AndroidManifest.xml文件。
这段代码在我的标签应用程序需要的工具栏(所以我不能从布局删除):
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(mViewPager);
从主XML删除工具栏。 – sumandas
这不适用于我的选项卡式活动,因为它会在我的MainActivity中出现错误。 ViewPager不能以这种方式工作:/ @sumandas – creativecreatorormaybenot
您能否请共享代码 – sumandas