how to hide up button in actionbar

前端 未结 4 1976
醉酒成梦
醉酒成梦 2021-01-02 17:16

I would like to do an edit mode, in the style of the tablet gmail app. If the user presses the edit button on the actionbar, than I would like to show him/her an action view

4条回答
  •  走了就别回头了
    2021-01-02 17:45

    This worked for me, though its a slight change in the above mentioned solution

    android.support.v7.app.ActionBar actionBar = getSupportActionBar();
            if (actionBar != null) {
                actionBar.setHomeButtonEnabled(false); // disable the button
                actionBar.setDisplayHomeAsUpEnabled(false); // remove the left caret
                actionBar.setDisplayShowHomeEnabled(false); // remove the icon
            }
    

提交回复
热议问题