简体   繁体   English

无法为Android设置SlidingMenu

[英]Unable to setup SlidingMenu for Android

I am trying to implement https://github.com/jfeinstein10/SlidingMenu in my project but keeps getting error after errors. 我正在尝试在我的项目中实现https://github.com/jfeinstein10/SlidingMenu ,但是在出错后不断出错。 I followed up some guides and got through some but was eventually stuck. 我跟进了一些指南,并通过了一些指南,但最终陷入了困境。

I have added in: 我添加了:

public class _iSellCrazyItem extends SherlockPreferenceActivity

But when i tried to add a menu into onCreate, most of the resources isn't found. 但是,当我尝试向onCreate中添加菜单时,找不到大多数资源。 I tried copying the menu.xml into my project and it removes an error. 我尝试将menu.xml复制到我的项目中,这消除了一个错误。

码

When i hover over the red line, it gives 当我将鼠标悬停在红线上方时,

(item) cannot be resolved or is not a type. (项目)无法解析或不是类型。

Edit: Changed to 编辑:更改为

public class _iSellCrazyItem extends SlidingFragmentActivity

but still, these 3 lines cannot be resolved 但仍然无法解决这三行

    menu.setShadowWidthRes(R.dimen.shadow_width);
    menu.setShadowDrawable(R.drawable.shadow);
    menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);

you have to exentds SlidingFragmentActivity instead of SherlockPreferenceActivity . 您必须超出SlidingFragmentActivity而不是SherlockPreferenceActivity Did you add the sliding menu library correctly to your project? 您是否向项目中正确添加了滑动菜单库?

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

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