I am trying to place a background image within a HorizontalScrollView
such that the entire width of my image is scrollable and such that the
excess height will be cropped. This seems like it should be
straightforward: no scaling, no centering... just peg it to the bottom
left corner and lop off the top. After going through various
permutations of 'scaleType' and juggling things around the layout, I
am beginning to think I can do almost everything except for what I
described above :)
Here is a basic dump of my layout
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/BackgroundImage"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_width="XXX"
android:layout_height="XXX"
android:scaleType="XXX"
... Other UI elements
The closest I have got so far, is by using the 'scaleType=centerCrop".
This will give me the correct horizontal scrolling and vertical image
cropping (no scaling just clips the excess). The only problem, is that
the vertical clipping is such that an equal amount is clipped from
both the top and bottom, when what I am shooting for is to only have
the top clipped.
Please help! The amount of time I have sunk into this one problem is
beginning to be a bit embarrassing :)
--
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