I want my inner RelativeLayout to wrap it's content and stay below the View element. Why isn't it behaving like the pic below?
My layout.xml
<?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">
<View
android:id="#+id/linearLayout"
android:layout_above="#+id/input_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<RelativeLayout
android:id="#+id/input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#ebebeb">
<EditText
android:id="#+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_toLeftOf="#+id/imageView13"
android:layout_toStartOf="#+id/imageView13"
android:background="#android:color/white"
android:padding="8dp" />
<ImageView
android:id="#+id/imageView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:src="#drawable/ic_m_send" />
</RelativeLayout>
</RelativeLayout>
remove android:layout_alignParentBottom="true" from both your EditText and ImageView will solve your proble.
Your RelativeLayout already have android:layout_alignParentBottom="true" and if you will set same for it's child also it will set layout height to full screen.
Note that you cannot have a circular dependency between the size of
the RelativeLayout and the position of its children. For example, you
cannot have a RelativeLayout whose height is set to WRAP_CONTENT and a
child set to ALIGN_PARENT_BOTTOM
Class Document
use this way
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="#+id/relChart"
android:layout_above="#+id/input_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<RelativeLayout
android:id="#+id/relChart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/background"
>
<EditText
android:id="#+id/editText1"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_centerVertical="true"
android:layout_margin="5dp"
android:layout_toLeftOf="#+id/ivSend"
android:background="#drawable/border_round_white3"
android:gravity="right|center_vertical"
android:paddingRight="10dp"
android:textColor="#android:color/black"
android:textCursorDrawable="#null"
android:maxLength="140"
/>
<ImageView
android:id="#+id/ivSend"
android:layout_width="40dp"
android:layout_height="35dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:contentDescription="#null"
android:padding="5dp"
android:src="#mipmap/send_icon" />
</RelativeLayout>
</RelativeLayout>
Related
Linerlayout will be not fit in full screen white background color displaying ..
Any ideas on making both sides Fit in fullscreen?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"\>
<Button
android:id="#+id/bClose"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_margin="0dp"
android:background="#drawable/round_button_background"
android:gravity="center_vertical|center_horizontal"
android:onClick="cancelActivity"
android:text="#string/x_close"
android:textColor="#FFF"
android:textSize="15sp"
android:textStyle="bold"
android:layout_alignParentTop="true"
/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:fillViewport="true"
android:gravity="center_vertical|center_horizontal"
android:id="#+id/preview_frag"
android:focusable="true">
<requestFocus />
</LinearLayout>
</RelativeLayout>
Can you try it using webview? adjust webview by implementing padding and margin in it.... use -(negative) values
This works totally fine. Try using match_parent instead of fill_parent.
Check if the image has white space.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="#+id/bClose"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="0dp"
android:background="#drawable/ic_event_white_24dp"
android:gravity="center_vertical|center_horizontal"
android:text="close"
android:textColor="#FFF"
android:textSize="15sp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/preview_frag"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:focusable="true"
android:background="#color/theme_primary"
android:gravity="center_vertical|center_horizontal"
android:orientation="horizontal">
<requestFocus />
</LinearLayout>
</RelativeLayout
The layout is correct, probably the issue is in the fragment layout since your LinearLayout seems to be a fragment container.
Check if your fragment_layout has some margin or padding.
Also as a suggest you should change from fill_parent to match_parent
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">
<Button
android:id="#+id/bClose"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_margin="0dp"
android:background="#drawable/round_button_background"
android:gravity="center_vertical|center_horizontal"
android:onClick="cancelActivity"
android:text="#string/x_close"
android:textColor="#FFF"
android:textSize="15sp"
android:textStyle="bold"
android:layout_alignParentTop="true"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:fillViewport="true"
android:gravity="center_vertical|center_horizontal"
android:id="#+id/preview_frag"
android:focusable="true">
<requestFocus />
</LinearLayout>
</RelativeLayout>
If you are looking to have the close button on top of the LinearLayout, you can try using the parent view as FrameLayout, something like so :-
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/frameLayout1">
<LinearLayout
android:orientation="vertical"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/linearLayout1"
android:background="#android:color/holo_blue_bright" />
<Button
android:text="Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/button1"
android:layout_gravity="right" />
</FrameLayout>
Output will be something like below:-
replace height and width property fill_parent to match_parent remove gravity from LinearLayout try above code
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="#+id/bClose"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_margin="0dp"
android:background="#drawable/round_button_background"
android:gravity="center_vertical|center_horizontal"
android:onClick="cancelActivity"
android:text="#string/x_close"
android:textColor="#FFF"
android:textSize="15sp"
android:textStyle="bold"
android:layout_alignParentTop="true"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/preview_frag">
</LinearLayout>
</RelativeLayout>
Try this
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="#+id/bClose"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="0dp"
android:background="#drawable/blockclose"
android:gravity="center_vertical|center_horizontal"
android:onClick="cancelActivity"
android:text="x_close"
android:textColor="#FFF"
android:textSize="15sp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/preview_frag"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:background="#drawable/bg"
android:focusable="true"
android:gravity="center_vertical|center_horizontal"
android:orientation="horizontal">
<requestFocus />
</LinearLayout>
</RelativeLayout>
if you are using imageview try using
android:scaleType="fitXY"
i also face the same problem, by giving negative margin values its works fine for me
example code
<body style='margin:-0.5px;'>
i hope above code will works for you
I want to align a scrollable TextView above a RelativeLayout) with 3 buttons at the bottom and a SeekBar above this buttons. The problem with my code is that the RelativeLayout takes the entire screen.
Here's my code:
<?xml version="1.0" encoding="utf-8"?>
<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:background="#drawable/images"
android:orientation="vertical"
tools:context="com.example.acer.aartisangrah.ekdanta">
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:id="#+id/textView9"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:enabled="true"
android:focusable="true"
android:longClickable="true"
android:textIsSelectable="true" />
</ScrollView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="#+id/b9"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="10dp"
android:onClick="decrease"
android:background="#drawable/zoomout1"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:id="#+id/b10"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:onClick="increase"
android:layout_marginRight="10dp"
android:background="#drawable/zoomin1"/>
<Button
android:layout_width="50dp"
android:layout_height="50dp"
android:id="#+id/button19"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="#drawable/play"/>
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/seekBar"
android:layout_above="#+id/b9"
android:configChanges="orientation|screenSize"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_toStartOf="#+id/b10"
android:layout_alignRight="#+id/b10"
android:layout_alignEnd="#+id/b10"
android:layout_weight="1"/>
</RelativeLayout>
</LinearLayout>
Check this image
Change the height of the ScrollView to android:layout_height="wrap_content"
and remove the android:layout_weight="1"
The following layout should do the job. Firstly, there was a circular dependency in height among <RelativeLayout> and <SeekBar>, so I fixed the height of <SeekBar>. Secondly, the android:layout_alightParentBottom="true" was messing with the layout manager, so removed that. Finally, moved the <SeekBar> above the buttons to easily manage the layout description. Here's the updated code:
<?xml version="1.0" encoding="utf-8"?>
<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:background="#drawable/images"
android:orientation="vertical"
tools:context="com.example.acer.aartisangrah.ekdanta">
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:id="#+id/textView9"
android:enabled="true"
android:focusable="true"
android:longClickable="true"
android:textIsSelectable="true" />
</ScrollView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<SeekBar
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/seekBar"
android:configChanges="orientation|screenSize"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_toStartOf="#+id/b10"
android:layout_alignRight="#+id/b10"
android:layout_alignEnd="#+id/b10"/>
<Button
android:id="#+id/b9"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="10dp"
android:onClick="decrease"
android:layout_below="#id/seekBar"
android:background="#drawable/zoomout1"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:id="#+id/b10"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:onClick="increase"
android:layout_below="#id/seekBar"
android:layout_marginRight="10dp"
android:background="#drawable/zoomin1"/>
<Button
android:layout_width="50dp"
android:layout_height="50dp"
android:id="#+id/button19"
android:layout_below="#id/seekBar"
android:layout_centerHorizontal="true"
android:background="#drawable/play"/>
</RelativeLayout>
</LinearLayout>
Your problem is you set ScrollView android:layout_height="0dp" and android:layout_weight="1"
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center">
and
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
so ScrollView takes nothing for hight
Edit
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
You can set android:layout_weight="1" as you want ratio between ScollView and RelativeLayout. Hare both will get half(1/2) of screen.
I'm trying to get the LinearLayout to be aligned at the bottom of this RelativeLayout. I tried setting alignParentBottom="true", but then I can't even see the contents of the LinearLayout. Is there another way to accomplish what I need?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="90dp"
android:layout_height="200dp"
android:minHeight="200dp"
android:background="#color/colorPrimaryDark"
android:elevation="2dp"
android:gravity="center">
<TextView
android:id="#+id/textView_bookName"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="1dp"
android:padding="10dp"
android:textSize="20dp"
android:textColor="#color/white"
/>
<TextView
android:id="#+id/textView_bookAuthor"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="1dp"
android:text="Author"
android:textSize="10dp"
android:textColor="#color/white"
android:layout_below="#+id/textView_bookName"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="#+id/textView_bookAuthor"
>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/button_download_book"
android:text="#string/download"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/button_read_book"
android:text="Read"
android:visibility="gone"/>
<ProgressBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/progressbar_book_download"
style="#android:style/Widget.ProgressBar.Horizontal"
android:progress="0"
android:visibility="gone"
/>
</LinearLayout>
</RelativeLayout>
Add to LinearLayout: android:layout_alignParentBottom="true"
eg.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_alignParentBottom="true"
android:layout_below="#+id/textView_bookAuthor">
[...]
<LinearLayout
android:layout_alignParentBottom="true"
android:layout_height="100dp"
android:layout_width="wrap_content">
</LineaLayout>
Try using a LinearLayout that contains both layouts and setting them an android:layout_weight and android:layout_height="0dp".
Don't forget to set the ratio between the weights to one you'd like and setting the container's android:orientation to vertical.
BTW, for textSize you better use sp and not dp...
Please try below xml which I have modified. It will solve the issue. I have removed the android:layout_below="#+id/textView_bookAuthor" and added android:layout_alignParentBottom="true".
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="90dp"
android:layout_height="200dp"
android:minHeight="200dp"
android:background="#color/colorPrimaryDark"
android:elevation="2dp"
android:gravity="center">
<TextView
android:id="#+id/textView_bookName"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="1dp"
android:padding="10dp"
android:textSize="20dp"
/>
<TextView
android:id="#+id/textView_bookAuthor"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="1dp"
android:text="Author"
android:textSize="10dp"
android:layout_below="#+id/textView_bookName"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical"
>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/button_download_book"
/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/button_read_book"
android:text="Read"
android:visibility="gone"/>
<ProgressBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/progressbar_book_download"
style="#android:style/Widget.ProgressBar.Horizontal"
android:progress="0"
android:visibility="gone"
/>
</LinearLayout>
</RelativeLayout>
I have three RelativeLauouts in a LinearLayout and I can't make it fill the whole screen on my emulator?? What is the problem?
Here is my xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/letteord"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:src="#drawable/letteord"
android:scaleType="centerCrop"
android:layout_alignParentEnd="true" />
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Let"
android:id="#+id/letteOrdbutton"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textSize="50dp"
android:background="#a4000000"
android:textColor="#FFFFFF" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/normaleord"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:src="#drawable/normaleord"
android:scaleType="centerCrop"
android:layout_alignParentEnd="true" />
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Normal"
android:id="#+id/normaleOrdbutton"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textColor="#FFFFFF"
android:background="#a4000000"
android:textSize="50dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/svaereord"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:src="#drawable/svaereord"
android:scaleType="centerCrop"
android:layout_alignParentEnd="true" />
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Svær"
android:id="#+id/svaereOrdbutton"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textSize="50dp"
android:textColor="#FFFFFF"
android:background="#a4000000" />
</RelativeLayout>
</LinearLayout>
I have tried changing the layout with and height but it still won't fill the whole screen as you can see on this screenshot:
Well, I see no paddings or margins in the code above. Is this just a portion of your code in your xml file? Check your main activity layout to see if there is any padding or margins. Delete them if there is and it should work fine.
I am trying to do the following in an xml layout. My parent Layout is a Relative Layout.
I want to make a child Relative Layout scrollable.
I have another child Relative Layout and I don't want to make it scrollable.
My xml file is below but the problem is that I whichever new widget(in this case the textview with text taskname) I am adding is getting displayed on the ImageView on the Relative Layout. I am not able to move it. Please guide me.
<?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"
>
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#android:color/white"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ImageView
android:id="#+id/imageView1"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/propic" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:layout_toRightOf="#+id/imageView1"
android:text="Jack Reacher" />
<View
android:id="#+id/View02"
android:layout_width="fill_parent"
android:layout_height="0.3dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="#android:color/darker_gray" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Task Name :" />
</RelativeLayout>
</ScrollView>
Your layout should be defined as
1- <ScrollView>
2- <LinearLayout>
3- <RelativeLayout>
// Try this way,hope this will help you to solve your problem...
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#android:color/white">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView1"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/propic" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:layout_toRightOf="#+id/imageView1"
android:text="Jack Reacher" />
<View
android:id="#+id/View02"
android:layout_width="match_parent"
android:layout_height="0.3dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="#android:color/darker_gray" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Task Name :" />
</RelativeLayout>
</ScrollView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
</RelativeLayout>
</LinearLayout>