Android customize action bar with api<11

后端 未结 2 1744
别跟我提以往
别跟我提以往 2020-12-07 06:06

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?

相关标签:
2条回答
  • 2020-12-07 06:47

    You have to write your own ActionBar

    0 讨论(0)
  • 2020-12-07 06:48

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

    Here is detailed info on how to implement it

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

    • Download the ActionBarSherlock library project and import it into Eclipse.

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

    • 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.)

    • 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).

    • Theming instructions are on the ActionBarSherlock website.

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

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

    0 讨论(0)
提交回复
热议问题