ActionBarDrawerToggle is not setting Drawer Indicator

前端 未结 4 1478
走了就别回头了
走了就别回头了 2021-02-04 06:09

I am trying to add the navigation drawer in my app.. Everything is working fine But now I still got the arrow icon although I replaced it with the ic_drawer from Android? Here\'

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-04 07:06

    You'll have to use

    getActionBar().setDisplayShowHomeEnabled(true);
    

    instead of

    getActionBar().setDisplayShowHomeEnabled(false);
    

    Cheers,

    Felix

    EDIT: Here's how to hide the Icon via XML:

    add this to your styles.xml: (Replace android:Widget.Holo.Light.ActionBar.Solid with android:Widget.Holo.ActionBar.Solid if you are using the dark action bar)

    
    

    and then add this to your Theme you have defined in AndroidManifest.xml (Standard is the AppBaseTheme in /res/values-v11/styles.xml - AppBaseTheme:

    @style/ActionBarStyle
    

    Hope this helps!

提交回复
热议问题