Reputation: 3288
I am trying to implement ActionBarSherlock with three tabs in the way that the tabs are placed in the same line as HomeButton. See the picture below:
I created the ActionBarSherlock and added the three tabs but they did not appear on the screen. What did I miss?
Here is my code:
//ActionBarSherlock settings
ActionBar actionBar=getSupportActionBar();
Resources res=getResources();
actionBar.setDisplayUseLogoEnabled(true);
actionBar.setLogo(res.getDrawable(R.drawable.logo));
actionBar.setSplitBackgroundDrawable(res.getDrawable(R.drawable.separator));
actionBar.setBackgroundDrawable(res.getDrawable(R.drawable.navbar));
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
//Tabs
actionBar.addTab(actionBar.newTab().setText("apps").setIcon(R.drawable.ico_apps_normal).setTabListener(this).setTag("apps tab"),true);
actionBar.addTab(actionBar.newTab().setIcon(R.drawable.ico_add_normal).setTabListener(this).setTag("add tab"));
actionBar.addTab(actionBar.newTab().setIcon(R.drawable.ico_news_normal).setTabListener(this).setTag("news tab"));
Upvotes: 1
Views: 705