0

I created my Keyboard. I need to show icon on one Key.

 Keyboard.Key key;
 key = this.getKeys().get( 0);
 Drawable icon = context.getResources().getDrawable( iKeyIcon); // iKeyIcon - id of my file resource with icon
 key.icon  = icon;

How can I set programmatically its height and width?

Kanth
  • 6,681
  • 3
  • 29
  • 41
Tapa Save
  • 4,769
  • 5
  • 32
  • 54
  • I find solution on http://stackoverflow.com/questions/4609456/android-set-drawable-size-programatically – Tapa Save Dec 24 '12 at 06:39
  • Drawable icon = context.getResources().getDrawable( iKeyIcon);Bitmap bitmapIcon = ((BitmapDrawable) icon).getBitmap(); icon = new BitmapDrawable( context.getResources(), Bitmap.createScaledBitmap( bitmapIcon, context.getResources().getInteger( R.integer.iConfigIconSize),context.getResources().getInteger( R.integer.iConfigIconSize),true)); key.icon = icon; – Tapa Save Dec 24 '12 at 06:40

0 Answers0