views:

143

answers:

2

I have a layout question.

Say I have a RelativeLayout appearing at the bottom of my screen. In this, I want to add 2 textviews, in the center, one in the top center and one in the bottom center.

|--------------------------|
|          Text1           |
|          Text2           |
|--------------------------|

Something like that :-)

A: 

How's this work for you:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:gravity="center_horizontal">
    <TextView android:id="@+id/text1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Text 1"/>   
    <TextView android:id="@+id/text2"
              android:layout_below="@id/text1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Text 2"/>
</RelativeLayout>
roundhill
Both the textview are appeared at "Center horizontal"...he asked that "one in top center and one in bottom center"
PM - Paresh Mayani
This'll work if he wants it just like the text picture he drew in the question... but he's disappeared so we'll never know :)
roundhill
A: 

Roundhill's should work. Check for DroidDraw - http://www.droiddraw.org/ ... sometimes i use it to clear myself of some minor doubts.

vikikivi