Probably too late, but ...
Actually Mike answered already similar question here Get reference to drawer toggle in support actionbar
I just reused his code. After you added the ActionBarDrawerToggle and called syncState() on it
final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
ActionBarDrawerToggle actionBarDrawerToggle = new ActionBarDrawerToggle(...);
//Setting the actionbarToggle to drawer layout
drawerLayout.setDrawerListener(actionBarDrawerToggle);
//calling sync state is necessay or else your hamburger icon wont show up
actionBarDrawerToggle.syncState();
you can iterate through children of the toolbar and then ...
for (int i = 0; i < toolbar.getChildCount(); i++) {
if(toolbar.getChildAt(i) instanceof ImageButton) {
ImageButton imageButton = (ImageButton) toolbar.getChildAt(i);
imageButton.setPadding(50, 100, 50, 50);
}
}
Hopefully it helps
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.