這裏是我的ActionBar
相關的代碼:如何隱藏我的動作條
ActionBar actionBar = getSupportActionBar();
actionBar.setTitle(R.string.app_name);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.setStackedBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.colorTextHint)));
actionBar.setDisplayShowHomeEnabled(true); // To Show the Home Icon
actionBar.setHomeButtonEnabled(false); // To get the click Event of the
// Home Button
actionBar.setDisplayHomeAsUpEnabled(true); // To Unable Home Button to
// work as a Navigation
// Drawer Opener.
pager = (ViewPager) findViewById(R.id.viewPager);
pager.setAdapter(new MyPagerAdapter(getSupportFragmentManager()));
for (String tab_name : tabs)
{
actionBar.addTab(actionBar.newTab().setText(tab_name).setTabListener(this));
}
actionBar.setSelectedNavigationItem(0);
我得到這個ActionBar
但我想只有這部分是我的ActionBar
:
預先感謝您的幫助&建議。
使用一個'Toolbar'作爲'ActionBar'並且放入任何你想要的東西。 – earthw0rmjim