Igor Kostenko
Igor Kostenko

Reputation: 2874

tab bar icons in an app overlapping the Tab text

I've implemented some tab bar icons in an app, but they seem to be overlapping the Tab text.

Icons and descriptions in Tabs

What am I doing wrong? Here's some code:

public class MyActivity extends SherlockFragmentActivity {
    FragmentTabHost mTabHost = (FragmentTabHost) findViewById(android.R.id.tabhost);
    mTabHost.setup(this, getSupportFragmentManager(), R.id.realtabcontent);
    mTabHost.addTab(mTabHost.newTabSpec("TeamsFragment").setIndicator("Teams",
    getResources().getDrawable(R.drawable.tab_bar_icon_teams_2x)), BaseFragment.class, null);
}

public class BaseFragment extends SherlockFragment {
}

Upvotes: 0

Views: 442

Answers (1)

maloney
maloney

Reputation: 1653

Try using a layout manager like MigLayout - this way you will be able to state exactly how you want your icons/buttons to look and where they should go. You're going to run into lots of problems if you don't use some sort of Layoutmanager...

Start by looking here: http://www.miglayout.com/QuickStart.pdf

Upvotes: 1

Related Questions