Ice Cream Sandwich (Android 4.0) adds the option of having the Action Bar
at the bottom of the screen on phones, and that's something I'd love to have in an application of mine. The docs mention uiOptions="splitActionBarWhenNarrow"
for when you want something, i.e. tabs, at the top and Action Bar
shortcuts at the bottom. I've tried adding the line in the application manifest, as described in the docs, but haven't got it working thus far.
Here's an example:
Also, I noticed that on my Galaxy Nexus, which runs ICS, that the messaging application has the Action Bar
the bottom and nothing but the title on the top, so it must be possible to somehow force the Action Bar
to be at the bottom.
Any ideas?
Edit here is the image :).
back again with a best results :). first thing you need to do is create a layout name it header.xml
after that go to your MainActivity.class and create this method.
add
setupActionBar();
to your onCreate Activity and run your app :).now you have custom ActionBar with Dividers and Images P.S the divider is defined in the layout as an image background :).
try this...
It worked for me in this sample project. Here is the manifest:
If you are referring to the conversation list, that is the
ActionBar
at the top and bottom, usingsplitActionBarWhenNarrow
and the following setup code:I'm using ActionBarSherlock and I had a similar problem. I solved it by putting
android:uiOptions="splitActionBarWhenNarrow"
within the<activity>
tag, rather than the<application>
tag.For example, this worked:
and this didn't work:
well you can't force to stay at the bottom on tablets but if phone yeah you can do that through the manifest. but you can do something is similar to bottom bar and top bar. will in this example i'll show you how to use merge to do that easily without the need of using android ActionBar.
first thing you need to create is your
main_activity.xml
in my case themain_activity.xml
only containsImageView
on RelativeLayout. here is the code.as you can see in above code, there are two merges i put inside the
main_activity.xml
one defined at bottom and one defined at the top. here is the fake bottom bar xml.i'm putting a fixed background to the
LinearLayout
and fake the ImageView for onClicks.and here is the top bar. `
`
which also copy paste from the bottom bar above. just change one thing from
android:layout_alignParentBottom="true"
toandroid:layout_alignParentTop="true"
and you got an actionBar at the bottom and at the top. in this case you wont need to use the ActionBar so i suggest you to useTheme.Holo.NoActionBar
and here is the image result :- http://i.imgur.com/N8uKg6v.png
this is a project i'm working on Now. done almost everything but still struggling with the design. hope my answer benefit you. please vote the answer up if you found it interesting.
best regards. ~Kosh