Sherlock ActionBar和滑动菜单

use*_*071 2 android actionbarsherlock slidingmenu

在我的应用程序中,我只想使用滑动菜单,我应该使用的操作栏是Sherlock Action栏.

我下载了两个库.滑动菜单

1:https://github.com/jfeinstein10/SlidingMenuSherlock Action栏

我可以单独使用这两个库.我需要在我的应用程序中一起使用.所以在搜索之后我发现我必须这样做

添加ActionBarSherlock作为SlidingMenu的依赖项进入我计划使用的SlidingActivities,使它们扩展Sherlock__Activity而不是__Activity.

虽然我将SAB添加到Sliding菜单作为依赖,我在eclipse中得到这样的错误.

Found 2 versions of android-support-v4.jar in the dependency list,
but not all the versions are identical (check is based on SHA-1 only at this time).
All versions of the libraries must be the same at this time.
Versions found are:
Path: C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc        \JakeWharton-ActionBarSherlock-e5c2d1c\library\libs\android-support-v4.jar
Length: 271754
SHA-1: 53307dc2bd2b69fd5533458ee11885f55807de4b
Path: C:\Users\Kamalone\Downloads\SlidingMenu-master\SlidingMenu-master\library    \libs\android-support-v4.jar
Length: 385685
SHA-1: 48c94ae70fa65718b382098237806a5909bb096e
Run Code Online (Sandbox Code Playgroud)

罐子不匹配!修复您的依赖项

那我该怎么办?

从sherlockAB中删除lib文件后,我得到像这样的manuy错误

C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:6: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.Solid'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:10: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.Solid'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:12: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.Solid.Inverse'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:15: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.TabView'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:17: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabView'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabView.Inverse'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:22: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.TabBar'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabBar'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:26: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabBar.Inverse'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values\abs__styles.xml:101: error: Error: No resource found that matches the given name: attr 'android:textAllCaps'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:29: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.TabText'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:31: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabText'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:33: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabText.Inverse'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:55: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionMode.Inverse'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values\abs__styles.xml:328: error: Error: No resource found that matches the given name: attr 'android:textAllCaps'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:93: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Menu'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:96: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Title'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:98: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Title.Inverse'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:100: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Subtitle'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:102: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Subtitle.Inverse'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:104: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Title'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:106: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Title.Inverse'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:108: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Subtitle'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:110: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Subtitle.Inverse'.
[2013-03-01 14:18:14 - SlidingMenuLibrary] C:\Users\Kamalone\Downloads\JakeWharton-ActionBarSherlock-4.2.0-0-g90939dc\JakeWharton-ActionBarSherlock-e5c2d1c\library\res\values-v14\abs__styles.xml:113: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.PopupMenu'.
Run Code Online (Sandbox Code Playgroud)

Gab*_*tti 5

这里的第一个问题是他们使用不同版本的支持库(android-support-v4.jars).

对于第二个问题,您必须使用其中一个Sherlock主题来运行项目.ActionBarSherlock需要许多定义才能正确设置操作栏的样式.因此它需要这些样式,你必须使用ABS主题.当然,您可以使用自己的主题,但必须使用Sherlock的主题作为您的主题.有关详细信息,请参阅Sherlock主题指南.

更改AndroidManifest.xml文件以使用Sherlock主题:

<application
   android:allowBackup="true"
   android:icon="@drawable/ic_launcher"
   android:label="@string/app_name"
   android:theme="@style/Theme.Sherlock.Light" >

   <!-- ... -->

</application>
Run Code Online (Sandbox Code Playgroud)

  • 对于第一个问题,单击所有具有依赖项的项目,在本例中为SherlockBar和SlidingMenu - > Android工具 - >添加支持库,安装它,它修复了我的问题. (2认同)