RelativeLayout Always at bottom - java

I'm trying to force a RelativeLayout to stay ALWAYS at the bottom of the screen so I wrote this code.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="#+id/main"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="#+id/myFirstLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<!-- other view here -->
</RelativeLayout>
<RelativeLayout
android:id="#+id/mySecondLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/myFirstLayout" >
<!-- Views -->
<LinearLayout
android:id="#+id/myLinearLayout"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:orientation="horizontal" >
</LinearLayout>
<!-- View here -->
</RelativeLayout>
<RelativeLayout
android:id="#+id/layoutAtBottom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="#+id/mySecondLayout" >
<LinearLayout
android:id="#+id/myLinearAtBottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="bottom"
android:orientation="vertical" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
This code works when I can scroll (in this case stays at bottom) but when I can't scroll the layout it's below of the mySecondLayout but not at bottom. Why? how can I fix it?

Pop the bottom linear out of the scroll view and eliminate the wrapped RelativeLayout to something like this:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="#+id/myLinearAtBottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="bottom"
android:orientation="vertical" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/myLinearAtBottom" >
<RelativeLayout
android:id="#+id/main"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="#+id/myFirstLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<!-- other view here -->
</RelativeLayout>
<RelativeLayout
android:id="#+id/mySecondLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/myFirstLayout" >
<!-- Views -->
<LinearLayout
android:id="#+id/myLinearLayout"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:orientation="horizontal" >
</LinearLayout>
<!-- View here -->
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>

Remove android:layout_below="#+id/mySecondLayout" and try again .
Hope it works

Use this layout.
<?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="wrap_content" >
<ScrollView
android:id="#+id/main"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/layoutAtBottom" >
<RelativeLayout
android:id="#+id/myFirstLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<!-- other view here -->
</RelativeLayout>
<RelativeLayout
android:id="#+id/mySecondLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/myFirstLayout" >
<!-- Views -->
<LinearLayout
android:id="#+id/myLinearLayout"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:orientation="horizontal" >
</LinearLayout>
<!-- View here -->
</RelativeLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/layoutAtBottom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<LinearLayout
android:id="#+id/myLinearAtBottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</RelativeLayout>
</RelativeLayout>

Related

How to make ListView resizable?

Picture 1
Picture 2
How to make ListView resizable?
This ListView is OK.
OK ListView 1 Picture
OK ListView 2 Picture
I have tried all the layouts. That doesn't help.
I have a fragment container:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/yellow"
tools:context=".MainActivity">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/fragmentsContainer"/>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white"
app:menu="#menu/menu"
android:id="#+id/bottomNavigation"
android:layout_alignParentBottom="true" />
</RelativeLayout>
OK Layout is Search Layout:
<?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:background="#color/yellow"
android:id="#+id/searchAndListViewContainer"
android:orientation="vertical">
<SearchView
android:id="#+id/searchView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorOfSearchView" />
<ListView
android:id="#+id/downloadedMusicListView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
unadabtable Layout :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/darkGreen">
<ListView
android:id="#+id/musicListView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
As you see Java Code will change Fragments container's inner content.
Two fragments are almost identical.
What's the problem?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<ListView
android:id="#+id/lv"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/tv_footer"
android:layout_below="#+id/tv_header" />
<TextView
android:id="#+id/tv_footer"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="#ff0000"
android:gravity="center"
android:text="Footer" />
<TextView
android:id="#+id/tv_header"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="#00ff00"
android:gravity="center"
android:orientation="vertical"
android:text="Header" />
</RelativeLayout>
you can do that in multiple ways. here you can set your own view as header and footer.

How to include layout at the bottom of another layout

step.xml:
<?xml version="1.0" encoding="utf-8"?>
<com.stepstone.stepper.StepperLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/stepperLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:ms_stepperType="dots" />
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="3dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="3dp">
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_name"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/firstname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="11"
android:maxLines="1"
android:hint="First name"
android:textColor="#000000"
android:maxLength="15"
android:tag="#+id/first_name"
android:textCursorDrawable="#null" />
</android.support.design.widget.TextInputLayout>
</RelativeLayout>
<include
android:id="#+id/bottom_Menu"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
layout="#layout/step"/>
</ScrollView>
This is the design of step.xml
This is the design of activity_main. In this I have included the step.xml
I need the output like this.
When I am trying to include step.xml in activity_main, I get the exception "Scroll view can only host one child view." Please help me.
Change your StepperLayout hight to wrap content.
step.xml :
<?xml version="1.0" encoding="utf-8"?>
<com.stepstone.stepper.StepperLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/stepperLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:ms_stepperType="dots" />
And change activity_main layout as following :
activity_main.xml:
<?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:id="#+id/profile_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:windowSoftInputMode="adjustResize|adjustPan">
<LinearLayout
android:id="#+id/profile_layout_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ScrollView
android:id="#+id/layout_scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingBottom="70dp"
android:paddingTop="3dp">
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_name"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/firstname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="11"
android:maxLines="1"
android:hint="First name"
android:textColor="#000000"
android:maxLength="15"
android:tag="#+id/first_name"
android:textCursorDrawable="#null" />
</android.support.design.widget.TextInputLayout>
</RelativeLayout>
</ScrollView>
</LinearLayout>
<RelativeLayout
android:id="#+id/btn_layout"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true">
<include
android:id="#+id/bottom_Menu"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
layout="#layout/step"/>
</RelativeLayout>
</RelativeLayout>
Use this code: Once the scroll view tag has ended add the step xml code like this.
<?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">
<LinearLayout
android:id="#+id/buttons"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_alignParentBottom="true">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Custom Button1"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Custom Button2"/>
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#id/buttons">
<!--Scrollable content here-->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="test text"
android:textSize="40dp"/>
</LinearLayout>
</ScrollView>
<com.stepstone.stepper.StepperLayout
android:id="#+id/stepperLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:ms_stepperType="dots" />
</RelativeLayout>
You should make a single child inside a scrollview (just as the error says). Wrap all the children inside of another (let's say) LinearLayout or RelativeLayout with wrap_content for both the width and the height as well as the vertical orientation.
From the Docs:
A ScrollView is a FrameLayout, meaning you should place one child in it containing the entire contents to scroll; this child may itself be a layout manager with a complex hierarchy of objects. A child that is often used is a LinearLayout in a vertical orientation, presenting a vertical array of top-level items that the user can scroll through.
EDIT
Simplest example can be like this:
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
// all the views currently in your ScrollView
</LinearLayout>
</ScrollView>
StepperLayout hight is match parent that's why it is in top position, Change you StepperLayout hight to wrap content
step.xml
<?xml version="1.0" encoding="utf-8"?>
<com.stepstone.stepper.StepperLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/stepperLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:ms_stepperType="dots" />
And ScrollView having only one child so move your include layout inside relative layout and add android:fillViewport="true" to ScrollView
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/ScrollView01"
android:layout_width="fill_parent"
android:fillViewport="true"
android:layout_height="fill_parent">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="3dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="3dp">
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_name"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/firstname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="11"
android:maxLines="1"
android:hint="First name"
android:textColor="#000000"
android:maxLength="15"
android:tag="#+id/first_name"
android:textCursorDrawable="#null" />
</android.support.design.widget.TextInputLayout>
<include
android:id="#+id/bottom_Menu"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
layout="#layout/step"/>
</RelativeLayout>
</ScrollView>

Button not displayed Android

I am having a linearlayout and scrollbar. I am trying to have button below the scrollbar.
Can you please suggest what I am doing wrong here.
Here is my XML code :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/linearLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ScrollView
android:id="#+id/scroll1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TableLayout
android:id="#+id/table_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</TableLayout>
</ScrollView>
<Button android:id="#+id/next_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next"
android:textColor="#android:color/background_light"
/>
</LinearLayout>
Thanks,
Aman
By setting ScrollView weight to 1 and height to 0dp it will wrap its height to fill all the space left after the Buttongets layouted to use wrap_content height:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/linearLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ScrollView
android:id="#+id/scroll1"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<TableLayout
android:id="#+id/table_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</TableLayout>
</ScrollView>
<Button
android:id="#+id/next_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next"
android:textColor="#android:color/background_light" />
</LinearLayout>
add
layout_weight
parameter to each part( i added 90% scrollview 10% button)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/linearLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ScrollView
android:id="#+id/scroll1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="9" >
<TableLayout
android:id="#+id/table_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</TableLayout>
</ScrollView>
<Button android:id="#+id/next_btn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Next"
android:textColor="#android:color/background_light"
android:layout_weight="1"
/>
</LinearLayout>
You should use Relative layout in place of LinearLayout. That will solve some problem
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/linearLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button
android:id="#+id/next_btn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Next"
android:layout_alignParentBottom="true"
android:textColor="#android:color/background_light"
/>
<ScrollView
android:id="#+id/scroll1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="#id/next_btn" >
<TableLayout
android:id="#+id/table_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</TableLayout>
</ScrollView>
</RelativeLayout>

Adding scroll in tabhost in android

I have a tab host in which i have more than 6 buttons. However the screen shows only 3-4 buttons.
Following is the code which i am using along with the image.
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#777777">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout
android:id="#+id/layTab"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:background="#drawable/navbar_background"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
>
<TabWidget
android:id="#android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
/>
</RelativeLayout>
<FrameLayout
android:id="#android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_above="#+id/layTab"/>
</RelativeLayout>
</TabHost>
The question is, How am i suppose to add a scroll so that i can scroll upto all 6 buttons or any other trick.
Best Regards
Just nest the TabWidget inside a HorizontalScrollingView, like this:
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#777777" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:id="#+id/layTab"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:background="#drawable/navbar_background"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:scrollbars="none" >
<TabWidget
android:id="#android:id/tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TabWidget>
</HorizontalScrollView>
</RelativeLayout>
<FrameLayout
android:id="#android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#+id/layTab"
android:layout_alignParentTop="true" />
</RelativeLayout>
</TabHost>
By the way, this solution works for many other scenarios, RadioGroup, for example

android align element at bottom of the screen

I am using android:layout_alignParentBottom="true" to align at parent bottom but for this particular case is not valid. Parent is a relative layout that has fixed size and bigger that screen height. Now I need to place a textview aligned at bottom of screen and not parent bottom. How to reach it? thank you.
<?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="600dp" >
<RelativeLayout
android:id="#+id/blogLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<WebView
android:id="#+id/webviewBlog"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="#android:color/black"
android:scrollbars="none"
android:fitsSystemWindows="true" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/Volver"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true">
<TextView
android:id="#+id/Volvertxt"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="Volver"
android:textColor="#android:color/white"
android:textSize="30px"
android:gravity="center"
android:clickable="true"
android:onClick="onClickVolver" />
</RelativeLayout>
</RelativeLayout>
I have modified your code hope it solves your problem
<?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="fill_parent" >
<WebView
android:id="#+id/webviewBlog"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="#android:color/black"
android:scrollbars="none"
android:fitsSystemWindows="true" />
<TextView
android:id="#+id/Volvertxt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="Volver"
android:textColor="#android:color/white"
android:textSize="30px"
android:gravity="center"
android:clickable="true"
android:onClick="onClickVolver" />
</RelativeLayout>
That is because, you are giving height in dp units of the parent layout. Make it match_parent.
EDIT:
<?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" >
<WebView
android:id="#+id/webviewBlog"
android:layout_width="fill_parent"
android:layout_height="600dp"
android:textColor="#android:color/black"
android:scrollbars="none"
android:fitsSystemWindows="true" />
<RelativeLayout
android:id="#+id/Volver"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true">
<TextView
android:id="#+id/Volvertxt"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="Volver"
android:textColor="#android:color/white"
android:textSize="30px"
android:gravity="center"
android:clickable="true"
android:onClick="onClickVolver" />
</RelativeLayout>
</RelativeLayout>

Categories

Resources