Library
compile('com.mikepenz:materialdrawer:4.4.6@aar') { transitive = true } Dynamically create NavigationDrawer and Header for it, I create it using
AccountHeader accountHeader = new AccountHeaderBuilder() .withActivity(this) .withHeaderBackground(R.drawable.main_icon) .build(); and then add it to
drawer = new DrawerBuilder(this) .withActivity(ActivityHome.this) .withAccountHeader(accountHeader) .withDisplayBelowStatusBar(true) .withToolbar(toolbar) .withActionBarDrawerToggleAnimated(true) .withSavedInstance(savedInstanceState) .addDrawerItems(primaryDrawerItems) .withSavedInstance(savedInstanceState) .withShowDrawerOnFirstLaunch(true) .build(); the image resource in the header added in this method .withHeaderBackground(R.drawable.main_icon) and in the end it looks like this
How to make the picture not stretch?
