[android-beginners] Re: Layout gravity - bug in portrait mode?

2009-05-12 Thread Anna PS
So I assumed the image would be as wide as the screen. But I guess it's limited by the number of pixels in the image. Do you set the android:scaleType? See ImageView.ScaleType: http://developer.android.com/reference/android/widget/ImageView.Scale... Ah - setting

[android-beginners] Re: Layout gravity - bug in portrait mode?

2009-05-12 Thread Anna PS
Argh - I'm afraid that the problem has reappeared. It recurs if I put the LinearLayout inside a ScrollView - in portrait mode, there is then once again a gap between the image and the bottom of the screen. This is true with either android:scaleType=centerCrop on the ImageView (Raphael's

[android-beginners] Re: Layout gravity - bug in portrait mode?

2009-05-12 Thread Romain Guy
Hi, Here's what you should do, inlined in your XML: ScrollView xmlns:android=http://schemas.android.com/apk/res/android;        android:layout_width=fill_parent android:layout_height=fill_parent android:padding=0dip Add android:fillViewport=true.        LinearLayout

[android-beginners] Re: Layout gravity - bug in portrait mode?

2009-05-10 Thread Anna PS
How can I get round this? Tactically, assuming this is a drawable resource, have two. Put your 320px edition in res/drawable under some name (e.g., background.png). Put your 480px edition in res/drawable-land-480x320 under the same name (e.g., background.png). Brilliant. Solves the

[android-beginners] Re: Layout gravity - bug in portrait mode?

2009-05-10 Thread Anna PS
On May 10, 6:45 am, Romain Guy romain...@google.com wrote: fill_parent means be as big as your parent, not take the remaining space. Hi Romain - yes, but in this case the parent is a LinearLayout, which also has layout_width set to fill_parent, and is filling the whole screen. So I assumed

[android-beginners] Re: Layout gravity - bug in portrait mode?

2009-05-10 Thread Raphael
On Sun, May 10, 2009 at 4:43 AM, Anna PS annapowellsm...@googlemail.com wrote: On May 10, 6:45 am, Romain Guy romain...@google.com wrote: fill_parent means be as big as your parent, not take the remaining space. Hi Romain - yes, but in this case the parent is a LinearLayout, which also has

[android-beginners] Re: Layout gravity - bug in portrait mode?

2009-05-09 Thread Mark Murphy
Anna PS wrote: I would like to align an ImageView with the very bottom of the screen. I've used android:layout_gravity=bottom, and another element with android:layout_weight=1 to push the ImageView down to the bottom. If you want to stick with LinearLayout, here are two suggestions: 1. If

[android-beginners] Re: Layout gravity - bug in portrait mode?

2009-05-09 Thread Anna PS
If you want to stick with LinearLayout, here are two suggestions: 1. If you want a spacer, use View rather than TextView. TextView has some intrinsic size, since it expects to have some text in some font. View has no size. 2. Try android:layout_height=0px on that spacer, rather than

[android-beginners] Re: Layout gravity - bug in portrait mode?

2009-05-09 Thread Anna PS
OK - I know what's causing the problem, but I don't know how to fix it. :-/ If the PNG image in the ImageView is less than 320 pixels wide (the width of the portrait screen), it works OK - the image aligns neatly with the bottom in both landscape and portrait mode. But if it's 320 pixels wide

[android-beginners] Re: Layout gravity - bug in portrait mode?

2009-05-09 Thread Mark Murphy
Anna PS wrote: OK - I know what's causing the problem, but I don't know how to fix it. :-/ If the PNG image in the ImageView is less than 320 pixels wide (the width of the portrait screen), it works OK - the image aligns neatly with the bottom in both landscape and portrait mode. But if

[android-beginners] Re: Layout gravity - bug in portrait mode?

2009-05-09 Thread Romain Guy
fill_parent means be as big as your parent, not take the remaining space. On May 9, 2009 12:11 PM, Anna PS annapowellsm...@googlemail.com wrote: OK - I know what's causing the problem, but I don't know how to fix it. :-/ If the PNG image in the ImageView is less than 320 pixels wide (the width