I have the following code:
viewPager = (ViewPager) findViewById(R.id.pager);
actionBar = getActionBar();
mAdapter = new TabPagerAdapter(getSupportFragmentManager(), myAccount);
viewPager.setAdapter(mAdapter);
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
actionBar.setCustomView(R.layout.actionbar);
actionBar.setHomeButtonEnabled(false);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
// ADD TABS
for (String tab_name : tabs) {
actionBar.addTab(actionBar.newTab().setText(tab_name)
.setTabListener(this));
}
And this is the result of the above code:
What i would like to do is to have my title to be placed above my tabs instead of the other way around as seen in the picture. How do i do this?
* EDIT 1 *
I can achieve this with the following code (not using custom layout)
viewPager = (ViewPager) findViewById(R.id.pager);
actionBar = getActionBar();
mAdapter = new TabPagerAdapter(getSupportFragmentManager(), myAccount);
viewPager.setAdapter(mAdapter);
actionBar.setHomeButtonEnabled(false);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
// ADD TABS
for (String tab_name : tabs) {
actionBar.addTab(actionBar.newTab().setText(tab_name)
.setTabListener(this));
}
Here is the screenshot:
I am trying to achieve this but using custom layout
They passing string array into tabs, like here tamil, english, hindi. Change that to watever you want.