我已经完成了 MenuSlider,但我只想在单击 actionBar 主页按钮时滑动,我不知道如何解决这个问题,因为我必须添加 4 个选项卡,然后导航到它们似乎很困难
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
StrictMode.enableDefaults();
Drawable d=getResources().getDrawable(R.drawable.action_bar);
actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
//actionBar.setTitle("Action Bar");
actionBar.setLogo(R.drawable.transparent);
//actionBar.setSubtitle("http://www.android.com");
actionBar.addOnMenuVisibilityListener(this);
actionBar.setBackgroundDrawable(d);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayUseLogoEnabled(true);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
getActionBar().setHomeButtonEnabled(true);
getOverflowMenu();
setBehindContentView(R.layout.left_tab);
setSlidingActionBarEnabled(true);
slideMenu = getSlidingMenu();
slideMenu.setMode(SlidingMenu.LEFT);
slideMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
slideMenu.setShadowWidthRes(R.dimen.slidingmenu_offset);
//slideMenu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
slideMenu.setBehindOffset(80);
slideMenu.setFadeDegree(0.99f);
inflater = getLayoutInflater();
//item = inflater.inflate(R.layout.left_tab, null);}
}