Materialdrawer: HeaderDrawer icon size

Created on 29 Mar 2017  路  4Comments  路  Source: mikepenz/MaterialDrawer

Hi! I have an problem when try to load an image on the icon of the drawer. When i load it the image gets cuted on the left as on the right side... Do we have an way to increase the size of the 'icon' ? Probably is one of the solutions...

billgates_is_my_father

Thanks!

Most helpful comment

@RafaHDu the image should be square. ;). So the solution of @abdelhedinizar is nice ;)

otherwise you can adjust the ImageView's image scaletype the same way of editing the header layout
https://github.com/mikepenz/MaterialDrawer/issues/1804

All 4 comments

Hi i solve it by resize the image i use this method

private Drawable resize(Drawable image) {
    Bitmap b = ((BitmapDrawable)image).getBitmap();
    Bitmap bitmapResized = Bitmap.createScaledBitmap(b,500,500, false);
    return new BitmapDrawable(getResources(), bitmapResized);
}

worked for me ,, @abdelhedinizar you are the best

@abdelhedinizar Thanks!!! Worked!! U the man ahah ;)

@RafaHDu the image should be square. ;). So the solution of @abdelhedinizar is nice ;)

otherwise you can adjust the ImageView's image scaletype the same way of editing the header layout
https://github.com/mikepenz/MaterialDrawer/issues/1804

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oleynikd picture oleynikd  路  4Comments

wayne1203 picture wayne1203  路  3Comments

HanderWei picture HanderWei  路  3Comments

Erwinstein picture Erwinstein  路  3Comments

ghost picture ghost  路  3Comments