views:

594

answers:

1

I tried multiple solution but none seem to work. Layout:

--------------------
|btn1|  txt1  |btn2|
--------------------
|                  |
|                  |
|                  |
|     txtview1     |
|                  |
|                  |
|                  |
--------------------

btn1 - top left aligned - decrease txt1
btn2 - top right aligned - increase txt1
txt1 - top center aligned - text/number entered with code
textview1 - client aligned with vertical scrollbar, if needed - text entered with code

+1  A: 

Try this:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <Button
        android:id="@+id/btn1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="btn1"/>

    <TextView
        android:id="@+id/txt1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:text="txt1"/>

    <Button
        android:id="@+id/btn2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:text="btn2"/>

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_below="@id/btn1">

        <TextView
            android:id="@+id/txt2"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:text="txt2"/>

    </ScrollView>

</RelativeLayout>
YaW
Very good, but txt2 is now also over btn1, txt2 and btn2. It should be under them.
Solata
ups, overlooked android:layout_below="@id/btn1".
Solata