Hi,
I have created a BitmapDrawable and have set the gravity to clip
vertically and to position at the bottom. Then I have added this to
the imageView object, but the clipping is ignored and instead is being
scaled instead. What am I doing wrong? Sample code below in an
Activity:
LinearLayout container = new LinearLayout(this);
LayoutUtils.Layout.WidthFill_HeightFill.applyLinearLayoutParams
(container);
container.setOrientation(LinearLayout.VERTICAL);
TextView tv = new TextView(this);
tv.setText("Sample text to be displayed above image");
container.addView(tv);
ImageView iv = new ImageView(this);
BitmapDrawable bd = new BitmapDrawable(SOME_LARGE_BITMAP);
bd.setGravity(Gravity.BOTTOM | Gravity.CLIP_VERTICAL);
iv.setImageDrawable(bd);
container.addView(iv, new LinearLayout.LayoutParams
(LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.FILL_PARENT, 1));
TextView tv2 = new TextView(this);
tv2.setText("Sample Text 2 below image");
container.addView(tv2);
I have even tried to set a small rectangle of 50x50 as the bound for
the BitmapDrawable and the ImageView still displays the whole image
scaled. All I want to do is be able to have the image gravity set and
clipped. Any help would be appreciated.
Sammy
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---