How to set the ActionBar title in middle instead of the default left aligned position?
问题 Trying to set the ActionBar title in middle instead of the default left aligned position. To do so, based on other answers this is what I've done: Toolbar myToolbar = (Toolbar) findViewById(R.id.toolbarDownloads); setSupportActionBar(myToolbar); if(getSupportActionBar()!=null) { getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); getSupportActionBar().setCustomView(R.layout.actionbar_layout); } actionbar_layout.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout