Android: Custom action bar,How to use entire width?

前端 未结 5 892
梦如初夏
梦如初夏 2020-12-10 04:54

Here is an image of my custom action bar:

\"enter

I want to use the entire wid

5条回答
  •  醉梦人生
    2020-12-10 05:47

     ActionBar action = getSupportActionBar();
            action.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
    
     Toolbar toolbar=(Toolbar)action.getCustomView().getParent();
            toolbar.setContentInsetsAbsolute(0, 0);
            toolbar.getContentInsetEnd();
            toolbar.setPadding(0, 0, 0, 0);
    

提交回复
热议问题