Setting the height and width through code probably doesn't work. But, not
very sure about it. But, it definitely works if you set the dimensions on
your layout file and then push in this image.

On Fri, Nov 12, 2010 at 5:56 AM, Bret Foreman <[email protected]>wrote:

> I'm using the following code, which I expect would scale the
> associated image to fit within the given dimensions of the button:
>
>                                ImageButton.setMaxHeight(32);
>                                ImageButton.setMaxWidth(32);
>
>  ImageButton.setScaleType(ImageView.ScaleType.FIT_CENTER);
>
>  editButton.setImageResource(R.drawable.ic_menu_edit);
>
> The image is 64X64 and I was expecting to see 32X32 on the screen.
> However, the button draws with the original 64X64 size. I can re-
> sample the image down and create a new file but I'm curious why this
> approach didn't work.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to