与API&LT Android的自定义操作栏; 11 [英] Android customize action bar with api<11

查看:133
本文介绍了与API&LT Android的自定义操作栏; 11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能定制我用API&LT行动起来吧,11?我不能使用actionBarSherlock,因为我与我的自定义ROM的一个问题...有没有办法做到这一点?

how can I customize my action bar with api<11? I can't use actionBarSherlock because I got an issue related to my custom rom...is there a way to do that?

推荐答案

您可以去大侦探行动吧。 ^ h ERE是链接一样

You can go For sherlock Action bar. here is link for the same

下面是详细信息如何实现它

  • 请确保您的项目采用Android 4.0+作为构建目标和 你有兼容性/支持库增加。 (您可以
    用鼠标右键单击该项目,选择Android的茨>添加支持库)

  • Make sure your project uses Android 4.0+ as the build target and that you have the compatibility/support library added. (You can
    right-click the project, select Android Toots > Add Support Library)

下载ActionBarSherlock库项目,并将其导入 月食。

Download the ActionBarSherlock library project and import it into Eclipse.

右键单击您的主项目,选择属性,选择Android的 在左窗格中。在底部窗口的一半,单击Add 按钮,选择ActionBarSherlock项目。单击确定。

Right-click your main project, select Properties, and select Android in the left pane. In the bottom half of the window, click the Add button and select the ActionBarSherlock project. Click OK.

而不是使用常规的活动和片段中,您使用的那些 夏洛特库。它们具有相同的名称,但prefixed与 大侦探(SherlockActivity,SherlockFragment,等等。)

Instead of using regular Activities and Fragments, you use ones from the Sherlock Library. They have the same names, but prefixed with "Sherlock" (SherlockActivity, SherlockFragment, etc.)

要访问code中的动作条,你叫getSupportActionBar()。本 返回无论是常规动作条(适用于蜂窝和更高版本)或 福尔摩斯动作条(为pre-蜂窝)。

To access the actionbar in code, you call getSupportActionBar(). This returns either the regular actionbar (for Honeycomb and later) or the Sherlock actionbar (for pre-Honeycomb).

主题化指令在ActionBarSherlock网站。

Theming instructions are on the ActionBarSherlock website.

您可以设置的android:minSdk在Android清单降低SDK说2.2,但是内置必须建立在目标4

You can set android:minSdk in android manifest to lower sdk say 2.2 but built have to build in target 4.

因此​​,它将在手机上与API级&LT; 11。 希望它能帮助。

So, it will work on handsets with api level < 11. Hope it helps.

这篇关于与API&LT Android的自定义操作栏; 11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆