Tuesday, November 15, 2011

[android-developers] ImageView with ScaleType.FIT_XY programmatically

Hi,

I have a problem. I have created a relativelayout with imageview
in my code like this:-

RelativeLayout relativelayout1 = new RelativeLayout(this);
RelativeLayout.LayoutParams r1 = new
RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
relativelayout1.setLayoutParams(r1);

ImageView view = new ImageView (this);
view.setScaleType(ScaleType.FIT_XY);

BItmap bitmap =
BitmapFactory.decodeResource(getResources(),R.drawable.texture);

RelativeLayout.LayoutParams r6 = new
RelativeLayout.LayoutParams(640,640);
r6.setMargins(0, 160, 0, 0);
view.setLayoutParams(r6);
view.setImageBitmap(bitmap);

But the imageview simply does not extend beyond the screen dimensions
of 320 * 480. Why is this happening and how can I solve this problem?
I want the imageview width and height extended beyond the screen
dimensions. How do I do it programmatically?

Thank you,
B.Arunkumar

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate