change back arrow image in Actionbar with appcompat-v7

前端 未结 3 1257
独厮守ぢ
独厮守ぢ 2021-01-20 16:58

I have an Actionbar from android.support.v7.widget.Toolbar. It has hamburger image with animation to back arrow, I want to change back arrow from &

3条回答
  •  梦谈多话
    2021-01-20 17:32

    Add this condition between mDrawerToggle = new ActionBarDrawerToggle... and mDrawerToggle.syncState(); like this :

    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    
    
    if (getResources().getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL)
    {
          toolbar.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
    }
    
    
    mDrawerToggle.syncState();
    

提交回复
热议问题