hi Mark,

I had already tried the RelativeLayout, but with no success, then when
i looked at my RelativeLayout attempt, i had
android:layout_gravity="bottom" instead of
android:layout_alignParentBottom="true".

But sorry to say this has failed to solve the problem. as soon as wrap
the RelativeLayout with a ScrollView, then the layout is all scrambled
again, and the image with the alignParentBottom stops to work!!
Then i found this link, http://www.anddev.org/viewtopic.php?p=26866,
which basically says to have;

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:padding="10px">
<ScrollView android:layout_width="fill_parent"
android:layout_height="wrap_content">
<RelativeLayout......>
Your content here: textview and other components
</RelativeLayout>
</ScrollView>
</LinearLayout>

but that fails to work as well, the problem again is with
android:layout_alignParentBottom="true" which isn't working.

cheers,
Simon

On Oct 11, 1:17 am, Mark Murphy <[email protected]> wrote:
> Simon wrote:
> > I'm trying to create a simple view of a header image, few buttons,
> > then footer image. I'm using a LinearLayout inside a ScrollView.
>
> > Even though i'm using the android:layout_gravity="bottom" for the
> > footer image, it's being placed about 1 cm above the bottom margin.
>
> > i'm using the following xml config
>
> > <?xml version="1.0" encoding="utf-8"?>
> > <ScrollView xmlns:android="http://schemas.android.com/apk/res/android";
> >     android:layout_width="fill_parent"
> >     android:layout_height="fill_parent"
> >     android:scrollbars="none"
> >     android:background="#FFFF">
>
> >    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> > android"
> >        android:orientation="vertical"
> >        android:layout_width="fill_parent"
> >        android:layout_height="fill_parent"
> >            android:background="#FFFF" >
>
> >            <ImageView
> >                    android:layout_width="fill_parent"
> >                    android:layout_height="wrap_content"
> >                    android:background="#FFFF"
> >                    android:src="@drawable/faa_header"
> >                    android:layout_gravity="top"/>
>
> >            <Button android:id="@+id/button_tutorial"
> >             android:text="@string/button_tutorial"
> >             android:layout_height="wrap_content"
> >             android:layout_width="fill_parent"/>
>
> >            <Button android:id="@+id/buttons_emergency_now"
> >             android:text="@string/buttons_emergency_now"
> >             android:layout_height="wrap_content"
> >             android:layout_width="fill_parent"/>
>
> >            <Button android:id="@+id/button_emergency_hints"
> >             android:text="@string/button_emergency_hints"
> >             android:layout_height="wrap_content"
> >             android:layout_weight="1"
> >            android:layout_width="fill_parent"/>
> >            <ImageView
> >                    android:layout_gravity="bottom"
> >                    android:layout_width="fill_parent"
> >                    android:layout_height="fill_parent"
> >                    android:background="#FFFF"
> >                    android:src="@drawable/footer"/>
> >    </LinearLayout>
> > </ScrollView>
>
> Try changing the LinearLayout from android:layout_height="fill_parent"
> (which I think may be meaningless when wrapped in a ScrollView) to
> android:layout_height="wrap_content".
>
> Or, switch from LinearLayout to RelativeLayout and anchor the ImageView
> to the bottom via android:layout_alignParentBottom="true".
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android App Developer Training:http://commonsware.com/training.html
--~--~---------~--~----~------------~-------~--~----~
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