In my application I use an ActionBar
(nether ABS nor the support action bar! minSDK = 14). The user may choose whether to use icon or text-based Tabs.
I'm still facing some issues while handling the screen rotation. Basically, I have a customView
set on the top (using getActionBar.setCustomView()
) in which some text and control elements are placed. In portrait mode everything works fine, but rotating the device messes up my UI.
I'm posting some screenshots to illustrate the issue (icons changed to dummy).
The problem here is that the tabs get stacked, I found no way to force the ActionBar
to stay 2-lined. If you know how to do it, I'd be really thankful for a solution.
So based upon the fact the ActionBar
will stay single-line in landscape mode, I tried at least to customize the background behind the tab text to match my design and it worked.
The real issue starts with icon mode. Portrait:
Everything's fine here. Rotating the device:
So as you can see, there's NO SPACE for the customView
and the tab area to be in one line. But since the android dev team believes their ActionBar
is smarter then us, the system totally disregards the lack of space, presses the tabs together and places the customView
to the right, causing it to overlap the tabs. This completely messes up my UI, and I'm looking for any possible solution (for some reasons I'm forced to use the ActionBar
and not something else).
If you need some code related to setting up the ActionBar, I'll post it, though it's pretty much a default implementation so I think this is irrelevant to the question. I'm asking about some basic ideas how to solve the described issue.