I have an ActionBar with a logo, title, three tabs and one action.
In portrait mode, everything looks good, because the tabs move to a complex ActionBar, for example: __ _______________
# My title ยค
_ ________________
Tab 1 | Tab 2 | Tab 3
__ _______________
But in landscape mode, the title is truncated because the tabs move to the top bar of the ActionBar, for example: __ ________________________
# My ... | Tab 1 | Tab 2 | Tab 3 | ยค
__ ________________________
Anyway, can I tell the ActionBar that the title should never be truncated? If not, can I at least set the width of the header? (This is normal for me if the tabs move to a complex ActionBar even in landscape mode)
EDIT:
Code requested. Here he is:
public class MyActivity extends SherlockFragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActionBar actionBar = super.getSupportActionBar(); actionBar.setHomeButtonEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); actionBar.setTitle("My Long Title"); actionBar.addTab(actionBar .newTab() .setText("Tab 1") .setTabListener( new TabListener<MyFragment>(this, "tab1", MyFragment.class, null))); actionBar.addTab(actionBar .newTab() .setText("Tab 2") .setTabListener( new TabListener<MyFragment>(this, "tab2", MyFragment.class, null))); actionBar.addTab(actionBar .newTab() .setText("Tab 3") .setTabListener( new TabListener<MyFragment>(this, "tab3", MyFragment.class, null))); } }
android android-layout android-actionbar
Anders
source share