I want to create an xml file for all layout which keeps same ratio and position in the device.
Here, is my layout design, that I want to create:
Here is my layout xml file:
When I use this xml, in some screen the round button not same size as my upper image, and the Text view(0.0km) middle of the "image" view and "round button" is not in the middle position:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="50dp"
android:layout_alignParentTop="true"
android:src="#drawable/firstscreenimage" />
</RelativeLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/button1"
android:layout_alignParentLeft="true"
android:layout_marginBottom="92dp"
android:gravity="right"
android:text="0.0km"
android:textSize="130dp" />
<Button
android:id="#+id/button1"
android:layout_width="400dp"
android:layout_height="400dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="150dp"
android:background="#drawable/animation0" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/button1"
android:textSize="35dp"
android:layout_alignBottom="#+id/button1"
android:layout_centerHorizontal="true"
android:text="Start" />
<EditText
android:id="#+id/campa"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="23dp"
android:ems="10" >
<requestFocus />
</EditText>
</RelativeLayout>
Here is the wrong layout:
Please help me, sorry for my poor english. Thank you....
Try this
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="50dp"
android:layout_alignParentTop="true"
android:src="#drawable/firstscreenimage" />
</RelativeLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/button1"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:gravity="right"
android:text="0.0km"
android:textSize="130dp" />
<Button
android:id="#+id/button1"
android:layout_width="400dp"
android:layout_height="400dp"
android:layout_centerInParent="true"
android:background="#drawable/animation0" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/button1"
android:textSize="35dp"
android:layout_alignBottom="#+id/button1"
android:layout_centerHorizontal="true"
android:text="Start" />
<EditText
android:id="#+id/campa"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="23dp"
android:ems="10" >
<requestFocus />
</EditText>
</RelativeLayout>
You need use a different image size and different layouts.
http://developer.android.com/design/style/iconography.html
http://developer.android.com/guide/practices/screens_support.html
Related
I have the following code with which i am trying to display at right corner of the title bar but its getting displayed in center.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="35dip"
android:gravity="center_vertical"
android:background="#drawable/formheader">
<ImageView
android:id="#+id/header"
android:background="#drawable/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ShowRoom"
android:textColor="#android:color/black"
android:textStyle="bold"/>
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:clickable="true"
android:background="#drawable/menu"/>
</LinearLayout>
These are the properties of RelativeLayout, So it won't work with LinearLayout.
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
Add android:layout_weight="1" to TextView.
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="ShowRoom"
android:textColor="#android:color/black"
android:textStyle="bold" />
Change it like below :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="35dip"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:id="#+id/header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/ic_launcher" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:text="ShowRoom"
android:textColor="#android:color/black"
android:textStyle="bold" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/ic_launcher"
android:clickable="true" />
</LinearLayout>
You can do it in 2 ways,
Follow #prag's answer if you want to continue with LinearLayout.
Another simplest way is to use RelativeLayout like below,
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="35dip"
android:gravity="center_vertical"
android:background="#drawable/formheader">
<ImageView
android:id="#+id/header"
android:background="#drawable/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/header"
android:layout_centerVertical="true"
android:text="ShowRoom"
android:textColor="#android:color/black"
android:textStyle="bold"/>
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:clickable="true"
android:background="#drawable/ic_launcher"/>
</RelativeLayout>
Try this layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="35dip"
android:orientation="horizontal" >
<ImageView
android:id="#+id/header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/ic_launcher" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="ShowRoom"
android:textColor="#android:color/black"
android:textStyle="bold" />
<View
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" >
</View>
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:background="#drawable/ic_launcher"
android:clickable="true" />
</LinearLayout>
Note: Replace my drawable image with yours. Hope this resolves your problem
I have a Back button on the top of my layout and i have placed the label text after that button. i need to center the label text, so that it should resemble like layout heading.Can anyone guide me on this task.
Hope u r looking for this
<RelativeLayout
android:id="#+id/header"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="#0fa2da" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Text View"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="23sp" />
<Button
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:src="#drawable/white_bar" />
<Button
android:id="#+id/back_button"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_alignBottom="#+id/imageView1"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="2dp"
android:layout_marginTop="2dp"
android:background="#148cba"
android:onClick="goBack"
android:text="Back"
android:textColor="#fff" />
</RelativeLayout>
Use this one:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:background="#ff0000"
android:layout_height="60dp" >
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Back" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/button1"
android:layout_alignBottom="#+id/button1"
android:layout_centerHorizontal="true"
android:text="Attractions"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
</LinearLayout>
Edited Code as per your response
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/rlt1"
android:orientation="horizontal"
tools:context=".MainActivity" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#24a6c6">
<ImageButton
android:id="#+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:src="#drawable/back_btn_img" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Attractions"
android:textColor="#fff"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
In RelativeLayout try to set your TextView as android:center_horizontal="true"
I have an custom dialog, whick i am inflating from dialog.xml. when I open the dialog it looks something like shown below. I am getting some space between listview and the (OK) button below it. I want to eliminate this space between the list view and the Button below it.
How can i do this,?
dialog.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/RelativeLayout1"
android:layout_width="wrap_content"
android:layout_height="fill_parent" >
<ListView
android:id="#+id/listViewDialog"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_above="#+id/button1"
android:layout_below="#+id/ImageView1" >
</ListView>
<CheckBox
android:id="#+id/checkBoxAll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/listView1"
android:layout_alignParentRight="true"
android:layout_marginBottom="15dp"
android:layout_marginRight="25dp"
android:layout_marginTop="15dp"
android:text="" />
<ImageView
android:id="#+id/ImageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="15dp"
android:layout_marginLeft="14dp"
android:layout_marginTop="15dp"
android:background="#FFFFBB33"
android:contentDescription="#string/app_name"
android:scaleType="center"
android:src="#drawable/alert_dialog_icon" />
<TextView
android:id="#+id/textView1"
android:layout_width="128dp"
android:layout_height="match_parent"
android:layout_above="#+id/listViewDialog"
android:layout_marginBottom="15dp"
android:layout_marginTop="15dp"
android:layout_toRightOf="#+id/ImageView1"
android:gravity="center_vertical"
android:text="Categories"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView1"
android:layout_alignBottom="#+id/textView1"
android:layout_toLeftOf="#+id/checkBoxAll"
android:text="All"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="#+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="OK" />
</RelativeLayout>
this is really easy..
you have 2 approchase:
1) create the root realtivelayout to have android:layout_height="wrap_cotent", and in the same time the ListView to have the same. this will shrink the sizes of the all dialog to the right (no space) size.
2) *more recomended , have the root to be a Linearlayout and give it some wightsum, then put the other views in this root, and give them some layout_wight, this way you know the in any screen resolution you have the same porportion of your screen.
maybe try like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/RelativeLayout1"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="100" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="15" >
<CheckBox
android:id="#+id/checkBoxAll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/listView1"
android:layout_alignParentRight="true"
android:layout_marginBottom="15dp"
android:layout_marginRight="25dp"
android:layout_marginTop="15dp" />
<ImageView
android:id="#+id/ImageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="15dp"
android:layout_marginLeft="14dp"
android:layout_marginTop="15dp"
android:background="#FFFFBB33"
android:contentDescription="#string/app_name"
android:scaleType="center" />
<TextView
android:id="#+id/textView1"
android:layout_width="128dp"
android:layout_height="match_parent"
android:layout_above="#+id/listViewDialog"
android:layout_marginBottom="15dp"
android:layout_marginTop="15dp"
android:layout_toRightOf="#+id/ImageView1"
android:gravity="center_vertical"
android:text="Categories"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView1"
android:layout_alignBottom="#+id/textView1"
android:layout_toLeftOf="#+id/checkBoxAll"
android:text="All"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<ListView
android:id="#+id/listViewDialog"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="70" >
</ListView>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="15" >
<Button
android:id="#+id/button1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="OK" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
I am trying to create very simple widget design. For the past two days I am still not able to complete it and I would appreciate your help.
What I am trying to do is something looks like this design:
Please note the size of the image buttons is 16pd for both height and width.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center"
android:layout_margin="4dp"
android:background="#drawable/background" >
<TextView
android:id="#+id/tvDisplayer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="HDisplaer"
android:textSize="25px"
android:gravity="center"/>
<TextView
android:id="#+id/tvsmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:textSize="7px"
android:gravity="center"/>
<ImageButton
android:id="#+id/imRefresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/refresh"
android:layout_gravity="left" />
<ImageButton
android:id="#+id/imOpen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/aboutus"
android:layout_gravity="right" />
</LinearLayout>
Wrap the ImageButtons with a RelativeLayout! Otherwise the code seems to be ok.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageButton
android:id="#+id/imRefresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/refresh"
android:layout_alignParentLeft="true" />
<ImageButton
android:id="#+id/imOpen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/aboutus"
android:layout_alignParentRight="true" />
</RelativeLayout>
If the TextViews are not centered, then wrap them with another RelativeLayout, and add to each TextView this line: android:layout_centerHorizontal="true"
Try this
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="50dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:text="TextView" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/textView1"
android:layout_centerInParent="true"
android:text="TextView" />
</RelativeLayout>
<ImageButton
android:id="#+id/imageButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/relativeLayout1"
android:src="#drawable/black" />
<ImageButton
android:id="#+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignTop="#+id/imageButton2"
android:src="#drawable/black" />
Just increase the height of the 2nd relative layout to bring it down.
Try this:
Just use two LinearLayout one for horizontal and other for vertical.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center"
android:layout_margin="4dp"
android:background="#drawable/background" >
<TextView
android:id="#+id/tvDisplayer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="HDisplaer"
android:textSize="25px"
android:gravity="center"/>
<TextView
android:id="#+id/tvsmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:textSize="7px"
android:gravity="center"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:gravity="center"
android:layout_margin="4dp"
>
<ImageButton
android:id="#+id/imRefresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left" />
<ImageButton
android:id="#+id/imOpen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right" />
</LinearLayout>
</LinearLayout>
is it possible to use RelativeLayout to have one area on top, which uses all available space (wich should be filled some Views dynamically) and to Buttons which should be on the lower end of the screen?
I tried following, but with no effort:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="#+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<FrameLayout
android:id="#+id/topFrame"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_margin="6dp">
<TextView
android:text="blabla"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</FrameLayout>
<Button android:id="#+id/button1"
android:text="Button 1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_below="#id/topFrame"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_margin="6dp" />
<Button android:id="#+id/button2"
android:text="Button 2"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_below="#id/button1"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_margin="6dp" />
whith this solution the button fills the space and not the FrameLayout.
TRy this:
<RelativeLayout......>
<FrameLayout
android:id="#+id/topFrame"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_margin="6dp">
<TextView
android:text="blabla"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</FrameLayout>
<RelativeLayout
android:id="#+id/InnerRelativeLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<Button
.....
</Button>
<Button
.....
</Button>
</RelativeLayout>
</RelativeLayout>
In the FrameLayout, change android:layout_height="wrap_content" to android:layout_height="fill_parent" then include android:layout_above="#+id/button1". It should force the force the FrameLayout to fill the space and always be above the first button.
Try this.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="#+id/RelativeLayout1"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/button1"
android:text="Button"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentLeft="true"/>
<Button android:layout_height="wrap_content"
android:id="#+id/button2"
android:text="Button"
android:layout_above="#+id/button1"
android:layout_width="fill_parent"
android:layout_alignParentLeft="true"/>
<FrameLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/frameLayout1"
android:layout_above="#+id/button2"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentLeft="true">
<TextView android:layout_height="wrap_content"
android:text="TextView"
android:layout_width="fill_parent"
android:id="#+id/textView1">
</TextView>
</FrameLayout>
</RelativeLayout>
Sorry if I missed something.