Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Tablet Application - ActionBar

We are trying to build an Android App for Samsung Galaxy Tablets. Is there a way we can increase the height of the ActionBar? We are using Android 3.1 API 12.

like image 816
umesh kumar Avatar asked Feb 01 '12 18:02

umesh kumar


People also ask

What is ActionBar in Android?

Android ActionBar is a menu bar that runs across the top of the activity screen in android. Android ActionBar can contain menu items which become visible when the user clicks the “menu” button. In general an ActionBar consists of the following four components: App Icon: App branding logo or icon will be displayed here.

What is the purpose of an ActionBar?

In Android applications, ActionBar is the element present at the top of the activity screen. It is a salient feature of a mobile application that has a consistent presence over all its activities. It provides a visual structure to the app and contains some of the frequently used elements for the users.

What is the difference between ActionBar and Toolbar?

What is the difference between the toolbar and the action bar? The most obvious difference between the two is the updated visual design of the toolbar. The toolbar no longer includes an icon on the left side and decreases some of the spacing between the action items on the right side.

How do I disable the action bar?

If you want to hide Action Bar from the entire application (from all Activities and fragments), then you can use this method. Just go to res -> values -> styles. xml and change the base application to “Theme. AppCompat.


1 Answers

You can apply a custom theme to your application.

Create styles.xml in your res/values/ directory and add something like this:

<style name="CustomTheme" parent="android:style/Theme">
    <item name="android:actionBarSize">@dimen/action_bar_default_height</item>
</style>

Then create dimens.xml in your res/values/ directory and add something like this:

<resources>
    <dimen name="action_bar_default_height">55dp</dimen>
</resources>

Then in your application manifest set the theme of the application like this:

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:logo="@drawable/ic_launcher"
    android:theme="@style/CustomTheme" >
...
</application>
like image 170
Larry McKenzie Avatar answered Sep 27 '22 19:09

Larry McKenzie