-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm refining the layouts of my application, and I have two small issues:

1. I've added some ScrollViews where needed so activities that are
taller than the physical screen can scroll. It mostly works, but when
there's plenty of screen height I'd like to have the activities flush
to the bottom (where I put some buttons). Without ScrollView it works
by using a special empty TextView with weight="1" so it acts as a
spacer; but with the ScrollView the activity always "packs" to its
minimum required height. I suppose I could solve this by specifying a
minHeight for the ScrollView and setting it to the physical screen
size, but I don't know how to do that - AFAIK minHeight only supports
a numeric measure.


<ScrollView xmlns:android="http://schemas.android.com/apk/res/android";
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <TextView
            android:id="@+id/tvTaxon"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            style="@android:style/TextAppearance.Large"
            android:paddingBottom="10dip"
            android:text="" />

    ...

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="1"
            android:text="" />

    ...

        <LinearLayout
            android:orientation="horizontal"
            android:gravity="center_horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" >

            <Button
                android:id="@+id/btOk"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight="0.5"
                android:minWidth="150dip"
                android:text="@string/ok"
                style="@android:style/TextAppearance.Large.Inverse" />
            <Button
                android:id="@+id/btAddMore"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight="0.5"
                android:minWidth="150dip"
                android:text="@string/addMore"
                style="@android:style/TextAppearance.Large.Inverse" />
        </LinearLayout>
    </LinearLayout>
</ScrollView>


2. The latter issue still refers to the previous layout and it's
related to the two buttons in the last LinearLayout. I'd like to have
them at the same width (it works) and centered horizontally. There's a
gravity="center_horizontal" in the LinearLayout that contains them,
still the first button is aligned to the left screen border.

- -- 
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
java.net/blog/fabriziogiudici - www.tidalwave.it/people
[email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvueGMACgkQeDweFqgUGxclyQCcD4bu5ja3uXRK2My9ypUa4WQQ
RnEAmgNUDwYSTxBlq7/fIC+1eZ8Jz/39
=ee8L
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" 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/javaposse?hl=en.

Reply via email to