Sunday, 18 August 2013

How can I make the action bar tabs on my application share equal weight/width across the screen?

How can I make the action bar tabs on my application share equal
weight/width across the screen?

I am following a tutorial on how to create tabs/swipe views for my Android
application.
I was able to complete the tutorial without issue. However, when I open
the main page on my tablet, the tabs are rather small. Ideally I would
like for the tabs to share equal weight/width across the screen.
Here's a screenshot of what the tabs look like on my tablet as well as
their ideal spacing (blue bars).

After extensive searching on StackOverflow and Google I cannot seem to
figure out how to change the tab widths. I noticed a lot of answers for
different methods of coding tabs/swipe views, but none seemed to apply for
the method that I'm using. However I acknowledge that I am just beginning
to learn Java and Android development so it is possible that I missed an
applicable solution.
You can find the exact source code that I am using on the website linked
above (link for "a tutorial") or, if you prefer, download a zip file of
the entire project to save some time.
If my request is not possible or ill advised, what method would you
recommend for achieving my goal?
Edit: After viewing the page for ActionBarSherlock it appears like that
might be the easiest method for implementation. However, for the sake of
learning and not having to add more code than I need, I'd still love to
hear an answer that doesn't utilize a third-party library.

No comments:

Post a Comment