Android Question Iconbutton problem

grafsoft

Well-Known Member
Licensed User
Longtime User
I am using Donmanfred's iconbutton library, and want to display one of Googles material icons on quite a small button.

What I get is a square filled with the color of the icon.

I thin it must be a problem with size.

Are the icons resized during display, or do I have to take care of the size?

B4X:
     Dim bm As BitmapDrawable
     bm.Initialize(LoadBitmap(File.DirAssets,"ic_play_black_48dp.png"))
     ' bm.Initialize(LoadBitmap(File.DirAssets,"ic_play.png"))
     bm.Gravity=Gravity.FILL
     b.IconPadding=1
    b.setIcon(False,bm)
 

grafsoft

Well-Known Member
Licensed User
Longtime User
I see it is really the size problem. How can I change t he size of a BitmapDrawable? I simply don't find it ...

funny: When I type "bm." I am offered Bitmap, Gravity and Initialize. When I try this

B4X:
bm.Bitmap.width=44px
bm.Bitmap.height=44px

the compiler gives me an error message
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
I see it is really the size problem. How can I change t he size of a BitmapDrawable? I simply don't find it ...

funny: When I type "bm." I am offered Bitmap, Gravity and Initialize. When I try this

B4X:
bm.Bitmap.width=44px
bm.Bitmap.height=44px

the compiler gives me an error message

Try "dip" instead of "px"
 
Upvote 0

grafsoft

Well-Known Member
Licensed User
Longtime User
Sorry, that was stupid of me.

But the result is not better:

upload_2016-1-19_16-26-2.png
 
Upvote 0

grafsoft

Well-Known Member
Licensed User
Longtime User
DonManfred: I know, but a bitmap should. Anyway, don't you think that one should adapt the size of the symbols to the different screen sizes?
 
Upvote 0
Top