1
1

More than 3 years have passed since last update.

[AndroidStudio] ActionBarDrawerToggleのハンバーガーメニューの色変更

Posted at

タイトルの通りです。
自分用メモ。

ハンバーガーメニューを白色にしたい場合

MainActivity.java
        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                this, drawer,toolbar,
                R.string.drawer_open,
                R.string.drawer_close);
        /* ハンバーガーメニューのdrawableをtoggleから取得 */
        DrawerArrowDrawable arrowDrawable = toggle.getDrawerArrowDrawable();
        /* 色の変更 */
        arrowDrawable.setColor(getResources().getColor(R.color.colorWhite));
     /* 色を変更したdrawableを再びセット */
        toggle.setDrawerArrowDrawable(arrowDrawable);

以上です。

他にいい方法があれば教えてください。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1