【问题标题】:Slidingdrawer toggle icon not visible滑动抽屉切换图标不可见
【发布时间】:2014-03-27 05:49:33
【问题描述】:

我正在尝试实现一个导航抽屉,除了切换按钮不可见之外,一切正常。

这是我的代码:

mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
                R.drawable.list, //nav menu toggle icon
                R.string.app_name, // nav drawer open - description for accessibility
                R.string.app_name // nav drawer close - description for accessibility) 

还添加了这些功能

@Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        // Sync the toggle state after onRestoreInstanceState has occurred.
        mDrawerToggle.syncState();
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        mDrawerToggle.onConfigurationChanged(newConfig);
    }

如何让它可见?

【问题讨论】:

  • 你使用的api级别是多少
  • min sdk version 8 and max: 19,我确实集成了actionbar scherlock,除了这个之外一切都很好
  • 好的..您在哪个设备上运行以及该设备的版本是什么
  • 三星 Galaxy y(android 2.3) 和 LG optimus(4.0.3)
  • getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true);

标签: android


【解决方案1】:

我们必须启用以下方法

getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-04
    相关资源
    最近更新 更多