Android relative layout problem
Posted
by DixieFlatline
on Stack Overflow
See other posts from Stack Overflow
or by DixieFlatline
Published on 2010-04-23T17:22:29Z
Indexed on
2010/04/23
17:23 UTC
Read the original article
Hit count: 674
Hello!
I just can't display the button at the bottom of the screen. I have 2 textviews and 2 edittexts set as gone, and they become visible when user clicks checkbox. It's only then that my button gets positioned properly Otherwise it sits on top of the app at launch of my app.(see here: http://www.shrani.si/f/3V/10G/4nnH4DtV/layoutproblem.png) I also tried android:layout_alignParentBottom="true" but that doesnt help either.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollview"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content">
<TextView android:id="@+id/txt1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Krajevna skupnost: "
android:layout_alignParentTop="true" />
<Spinner
android:id="@+id/spinner1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:prompt="@string/ks_prompt"
android:layout_below="@id/txt1"
/>
<TextView android:id="@+id/txt2" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Zadeva: "
android:layout_below="@id/spinner1" />
<Spinner
android:id="@+id/spinner2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:prompt="@string/pod_prompt"
android:layout_below="@id/txt2"
/>
<TextView android:id="@+id/tv1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Zadeva: "
android:layout_below="@id/spinner2" />
<EditText android:id="@+id/prvi" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_below="@id/tv1" />
<TextView android:id="@+id/tv2" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_below="@id/prvi"
android:text="Vsebina: " />
<EditText android:id="@+id/drugi" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_below="@id/tv2" />
<CheckBox android:id="@+id/cek" android:text="Obvešcaj o odgovoru"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_below="@id/drugi" />
<TextView android:id="@+id/tv3" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_below="@id/cek"
android:text="Email: "
android:visibility="gone"/>
<EditText android:id="@+id/tretji" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_below="@id/tv3"
android:visibility="gone" />
<TextView android:id="@+id/tv4" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_below="@id/tretji"
android:visibility="gone"
android:text="Telefon: " />
<EditText android:id="@+id/cetrti" android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_below="@id/tv4" />
<Button android:id="@+id/gumb"
android:text="Klikni"
android:typeface="serif" android:textStyle="bold"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_below="@id/cetrti" />
</RelativeLayout>
</ScrollView>
© Stack Overflow or respective owner