简体   繁体   English

Android平板电脑应用程序-ActionBar

[英]Android Tablet Application - ActionBar

We are trying to build an Android App for Samsung Galaxy Tablets. 我们正在尝试为Samsung Galaxy Tablets开发一个Android应用程序。 Is there a way we can increase the height of the ActionBar? 有没有办法增加ActionBar的高度? We are using Android 3.1 API 12. 我们正在使用Android 3.1 API 12。

You can apply a custom theme to your application. 您可以将自定义主题应用于您的应用程序。

Create styles.xml in your res/values/ directory and add something like this: 在res / values /目录中创建styles.xml并添加如下内容:

<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: 然后在res / values /目录中创建dimens.xml并添加如下内容:

<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>

You will need to create a custom Action Bar. 您将需要创建一个自定义操作栏。

Here is a good tutorial 这是一个很好的教程

Creating a custom Action bar 创建自定义操作栏

Also here is a good example from the dev site. 这也是来自开发站点的一个很好的例子。

Android Action Bar Android操作栏

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM