I am trying to create a UI using relative layout where in the UI should look as such:
- In the top of the screen i have a TextView
- followed by another TextView
- followed by scroll view where in i have to display the text in the
scrollable format - in the end i have a imageview.
How can i achieve this.
I have tried using the combination of Relative and Linear Layout but the elements gets overlapped. Anyone have any suggestions on how to proceed?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:background="@drawable/background_main" android:id="@+id/g_description">
<TextView android:id="@+id/titleBar" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:background="@drawable/header"
android:layout_alignParentTop="true" android:gravity="center"
android:text="@string/aboutus" android:textAppearance="? android:attr/textAppearanceLarge"
android:textStyle="bold" />
<TextView android:id="@+id/wd_name"
android:layout_width="fill_parent" android:layout_below="@id/titleBar"
android:layout_height="wrap_content" android:textStyle="bold"
android:textColor="#FFFFFF" android:textSize="18dip"
android:background="@drawable/background_main" android:gravity="center" />
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrolltext" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_below="@id/wd_name"
android:padding="5dip">
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/wd_description"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:textSize="14dip" android:textColor="#FFFFFF">
</TextView>
</LinearLayout>
</ScrollView>
<ImageView android:id="@+id/bottomBar" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:src="@drawable/bottom_bar"
android:layout_alignParentBottom="true" />
It works fine with setting android:orientation=”vertical” for each text view.