1

私はhttps://github.com/jfeinstein10/SlidingMenu非常に興味深く、actionbarsherlock 4.2 を使用して既存のプロジェクトで使用したいと考えています。Slidingmenu のライブラリを Android の既存プロジェクトとしてインポートしました。次に、プロジェクトのプロパティに移動し、slidingmenu プロジェクトをライブラリとして追加しましたが、SlidingMenu menu = new SlidingMenu(this); でエラーが発生しました。赤い「!」もあります。私のプロジェクトのフォルダに。

ここに画像の説明を入力

ここに画像の説明を入力

スライド メニューを初めて使用するので、ヘルプが必要です。どうもありがとうございます。

更新:ほとんどのエラーを修正しましたが、これを解決する方法がわからないエラーがあります ここに画像の説明を入力

最新のエラー:

Description Resource    Path    Location    Type

ACTION_POINTER_INDEX_MASK cannot be resolved or is not a field  CustomViewAbove.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 659    Java Problem

ACTION_POINTER_INDEX_MASK cannot be resolved or is not a field  CustomViewAbove.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 660    Java Problem
error: Error: String types not allowed (at 'layout_height' with value 'match_parent').  
list.xml    /SlidingMenuActivity/res/layout line 2  Android AAPT Problem

error: Error: String types not allowed (at 'layout_height' with value 'match_parent').  shadow.xml  /SlidingMenuActivity/res/layout line 2  Android AAPT Problem

error: Error: String types not allowed (at 'layout_width' with value 'match_parent').   list.xml    /SlidingMenuActivity/res/layout line 2  Android AAPT Problem

MapActivity cannot be resolved to a type    SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 11 Java Problem

MapActivity cannot be resolved to a type    SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 20 Java Problem

MapActivity cannot be resolved to a type    SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 30 Java Problem

MapActivity cannot be resolved to a type    SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 39 Java Problem

MapActivity cannot be resolved to a type    SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 50 Java Problem

MapActivity cannot be resolved to a type    SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 75 Java Problem

MapActivity cannot be resolved to a type    SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 149    Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingActivity.java    /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 68 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingActivity.java    /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 68 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingActivity.java    /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 91 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingActivity.java    /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 91 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingActivityHelper.java  /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 87 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingActivityHelper.java  /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 87 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingFragmentActivity.java    /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 68 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingFragmentActivity.java    /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 68 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingFragmentActivity.java    /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 91 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingFragmentActivity.java    /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 91 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingListActivity.java    /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 72 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingListActivity.java    /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 72 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingListActivity.java    /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 95 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingListActivity.java    /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 95 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 67 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 67 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 90 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 90 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 195    Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 195    Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 198    Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 198    Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 298    Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingMenu.java    
/SlidingMenuActivity/src/com/slidingmenu/lib    line 298    Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingPreferenceActivity.java  /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 68 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingPreferenceActivity.java  /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 68 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingPreferenceActivity.java  /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 91 Java Problem

MATCH_PARENT cannot be resolved or is not a field   SlidingPreferenceActivity.java  /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 91 Java Problem

R cannot be resolved to a variable  CustomViewAbove.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 859    Java Problem

R cannot be resolved to a variable  CustomViewAbove.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 878    Java Problem

R cannot be resolved to a variable  CustomViewAbove.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 883    Java Problem

R cannot be resolved to a variable  SlidingActivityHelper.java  /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 46 Java Problem

R cannot be resolved to a variable  SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 222    Java Problem

R cannot be resolved to a variable  SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 224    Java Problem

R cannot be resolved to a variable  SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 226    Java Problem

R cannot be resolved to a variable  SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 232    Java Problem

R cannot be resolved to a variable  SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 238    Java Problem

R cannot be resolved to a variable  SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 241    Java Problem

R cannot be resolved to a variable  SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 242    Java Problem

R cannot be resolved to a variable  SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 251    Java Problem

R cannot be resolved to a variable  SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 253    Java Problem

R cannot be resolved to a variable  SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 257    Java Problem

R cannot be resolved to a variable  SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 259    Java Problem

R cannot be resolved to a variable  SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 261    Java Problem

R cannot be resolved to a variable  SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 263    Java Problem

R cannot be resolved to a variable  SlidingMenu.java    /SlidingMenuActivity/src/com/slidingmenu/lib    line 265    Java Problem

The constructor SlidingActivityHelper(SlidingMapActivity) is undefined  SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 21 Java 
Problem

The container 'Android Dependencies' references non existing library '/Users/g3o/Documents/workspace/SlidingMenu/library/bin/slidingmenuactivity.jar'   Waiter      
Build path  Build Path Problem

The import com.google cannot be resolved    SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 8  Java Problem

The import com.slidingmenu.lib.R cannot be resolved SlidingActivityHelper.java  /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 12 Java Problem

The method findViewById(int) of type SlidingMapActivity must override or implement a supertype method   SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 38 Java Problem

The method getLayoutInflater() is undefined for the type SlidingMapActivity SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 59 Java Problem

The method getLayoutInflater() is undefined for the type SlidingMapActivity SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 83 Java Problem

The method onCreate(Bundle) of type SlidingMapActivity must override or implement a supertype method    SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 19 Java Problem

The method onKeyUp(int, KeyEvent) of type SlidingMapActivity must override or implement a supertype method  SlidingMapActivity.java 

/SlidingMenuActivity/src/com/slidingmenu/lib/app    line 146    Java Problem

The method onPostCreate(Bundle) of type SlidingMapActivity must override or implement a supertype method    SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 29 Java Problem

The method onSaveInstanceState(Bundle) of type SlidingMapActivity must override or implement a supertype method SlidingMapActivity.java 

/SlidingMenuActivity/src/com/slidingmenu/lib/app    line 49 Java Problem

The method setContentView(int) of type SlidingMapActivity must override or implement a supertype method SlidingMapActivity.java /SlidingMenuActivity/src/com/slidingmenu/lib/app    line 58 Java Problem

The method setContentView(View, ViewGroup.LayoutParams) of type SlidingMapActivity must override or implement a supertype method    SlidingMapActivity.java 

/SlidingMenuActivity/src/com/slidingmenu/lib/app    line 74 Java Problem

The method setContentView(View) of type SlidingMapActivity must override or implement a supertype method    SlidingMapActivity.java 

/SlidingMenuActivity/src/com/slidingmenu/lib/app    line 66 Java Problem

The project cannot be built until build path errors are resolved    Waiter      Unknown Java Problem

解決済み ActionBarSherlock、Slidemenu、およびプロジェクトの両方で Goole API を変更したところ、すべてのエラーが消えました

4

2 に答える 2

3

解決策: ActionBarSherlock、Slidemenu、およびプロジェクトの両方で Goole API を変更したところ、すべてのエラーが消えました。

于 2013-01-02T23:29:10.810 に答える
2

SlidingMenuクラスを拡張する必要があります。ActionBar Sherlockライブラリ使用するには、 Readmeに記載されている手順、特に次の手順に従う必要があります。

  • 使用する予定のSlidingActivitiesに移動し、__ ActivityではなくSherlock__Activityを拡張します。

したがって、プロジェクトはSlidingActivityを拡張する必要があります。

public class Waiter extends SlidingActivity {

また、ABSを使用するには、SlidingMenuライブラリのコピーを変更する必要があります。開いcom/slidingmenu/lib/app/SlidingActivity.javaて変更する:

public class SlidingActivity extends Activity implements SlidingActivityBase {

に:

public class SlidingActivity extends SherlockActivity implements SlidingActivityBase {
//             Add "Sherlock" here:  ^^^^^^^^

(使用したい他のSlidingMenuアクティビティについては、この手順を繰り返してください。)

于 2012-12-31T21:38:49.687 に答える