I have a ListView that I'm populating with an ArrayAdapter.Its work fine most of devices.But i have one karbonn(320x480) device which unable to display list.My application contain many listview they display properly on karbonn.
My .xml file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e6f0f5"
tools:context=".Save_educationActivity" >
<RelativeLayout
android:id="#+id/btnlayout"
android:layout_width="match_parent"
android:layout_height="47dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#4791FF"
android:orientation="horizontal" >
<ImageButton
android:id="#+id/xibtn_save_education"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="5dp"
android:background="#4791FF"
android:src="#drawable/ic_action_save" />
<ImageButton
android:id="#+id/xibtn_back_to_education"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:background="#4791FF"
android:src="#drawable/ic_action_back" />
</RelativeLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/btnlayout"
android:layout_marginTop="3dp"
android:text="#string/Education_title" />
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/textView1" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Course Name"
android:textSize="18dp"
android:textStyle="bold" />
</RelativeLayout>
</ScrollView>
<EditText
android:id="#+id/xedt_course"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/scrollView1"
android:ems="10"
android:inputType="textPersonName" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/xedt_course"
android:text="Date"
android:textSize="18dp"
android:textStyle="bold" />
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView3"
android:text="Joining Date"
android:textSize="18dp" />
<TextView
android:id="#+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/TextView01"
android:layout_alignBottom="#+id/TextView01"
android:layout_alignLeft="#+id/lvdate"
android:text="Leave Date"
android:textSize="18dp" />
<EditText
android:id="#+id/jdate"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/TextView01"
android:ems="10"
android:hint="Joining Date"
android:inputType="textPersonName" />
<EditText
android:id="#+id/lvdate"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/TextView02"
android:ems="10"
android:hint="Leaving Date"
android:inputType="textPersonName" >
<requestFocus />
</EditText>
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="#+id/jdate"
android:layout_marginTop="10dp"
android:background="#ffffff"
android:orientation="horizontal" >
<Button
android:id="#+id/btn_education_desc"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:background="#drawable/date_stroke"
android:text="Add Description"
android:textColor="#ffffff"
android:textSize="20dp" />
<ImageButton
android:id="#+id/add_edu_desc"
android:layout_width="70dp"
android:layout_height="match_parent"
android:background="#drawable/date_stroke"
android:src="#drawable/ic_action_new"
android:visibility="gone" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/linearLayout1">
<ListView
android:id="#+id/lst_eductndesc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true" >
</ListView>
</RelativeLayout>
</RelativeLayout>
You have very buggy layout. I will show you tour mistakes:
<RelativeLayout
android:id="#+id/btnlayout"
android:layout_width="match_parent"
android:layout_height="47dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#4791FF"
android:orientation="horizontal" > // there is no such attribute in relative layout
<ImageButton
android:id="#+id/xibtn_save_education"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="5dp"
android:background="#4791FF"
android:src="#drawable/ic_action_save" />
<ImageButton
android:id="#+id/xibtn_back_to_education"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:background="#4791FF"
android:src="#drawable/ic_action_back" />
</RelativeLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/btnlayout"
android:layout_marginTop="3dp"
android:text="#string/Education_title" />
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" // which size of scroll view you expected here? It will grow with their content and never have scroll.
android:layout_below="#+id/textView1" >
<RelativeLayout // you don't need to have relative layout here.
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Course Name"
android:textSize="18dp"
android:textStyle="bold" />
</RelativeLayout>
</ScrollView>
<EditText
android:id="#+id/xedt_course"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/scrollView1"
android:ems="10"
android:inputType="textPersonName" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/xedt_course"
android:text="Date"
android:textSize="18dp"
android:textStyle="bold" />
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView3"
android:text="Joining Date"
android:textSize="18dp" />
<TextView
android:id="#+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/TextView01"
android:layout_alignBottom="#+id/TextView01"
android:layout_alignLeft="#+id/lvdate"
android:text="Leave Date"
android:textSize="18dp" />
<EditText
android:id="#+id/jdate"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/TextView01"
android:ems="10"
android:hint="Joining Date"
android:inputType="textPersonName" />
<EditText
android:id="#+id/lvdate"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/TextView02"
android:ems="10"
android:hint="Leaving Date"
android:inputType="textPersonName" >
<requestFocus />
</EditText>
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="#+id/jdate"
android:layout_marginTop="10dp"
android:background="#ffffff"
android:orientation="horizontal" >
<Button
android:id="#+id/btn_education_desc"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:background="#drawable/date_stroke"
android:text="Add Description"
android:textColor="#ffffff"
android:textSize="20dp" />
<ImageButton
android:id="#+id/add_edu_desc"
android:layout_width="70dp"
android:layout_height="match_parent"
android:background="#drawable/date_stroke"
android:src="#drawable/ic_action_new"
android:visibility="gone" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" // which height you expect here? It will have height the same as parent, but draws somewhere at the bottom. It will draw a large part of view outside of screen.
android:layout_below="#+id/linearLayout1">
<ListView
android:id="#+id/lst_eductndesc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true" >
</ListView>
</RelativeLayout>
I think you need reformat your layout at all. If you will show image what you want to achieve and explain it's behavior, I will help to write more effeicient and clean xml.
You can make your layout like this:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e6f0f5"
tools:context=".Save_educationActivity"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/btnlayout"
android:layout_width="match_parent"
android:layout_height="47dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#4791FF"
android:orientation="horizontal" > // there is no such attribute in relative layout
<ImageButton
android:id="#+id/xibtn_save_education"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="5dp"
android:background="#4791FF"
android:src="#drawable/ic_action_save" />
<ImageButton
android:id="#+id/xibtn_back_to_education"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:background="#4791FF"
android:src="#drawable/ic_action_back" />
</RelativeLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="#string/Education_title" />
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="50dp" // you must declare your height exactly here
>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Course Name"
android:textSize="18dp"
android:textStyle="bold" />
</ScrollView>
<EditText
android:id="#+id/xedt_course"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/scrollView1"
android:ems="10"
android:inputType="textPersonName" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/xedt_course"
android:text="Date"
android:textSize="18dp"
android:textStyle="bold" />
<LinearLayout layout_width="match_parent"
layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout layout_width="0dp"
laout_weight="1"
layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView3"
android:text="Joining Date"
android:textSize="18dp" />
<EditText
android:id="#+id/jdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Joining Date"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout layout_width="0dp"
laout_weight="1"
layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Leave Date"
android:textSize="18dp" />
<EditText
android:id="#+id/lvdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Leaving Date"
android:inputType="textPersonName" >
</EditText>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:background="#ffffff"
android:orientation="horizontal" >
<Button
android:id="#+id/btn_education_desc"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:background="#drawable/date_stroke"
android:text="Add Description"
android:textColor="#ffffff"
android:textSize="20dp" />
<ImageButton
android:id="#+id/add_edu_desc"
android:layout_width="70dp"
android:layout_height="match_parent"
android:background="#drawable/date_stroke"
android:src="#drawable/ic_action_new"
android:visibility="gone" />
</LinearLayout>
<ListView
android:id="#+id/lst_eductndesc"
android:layout_width="match_parent"
android:layout_height="0dp"
layout_weight="1"
android:layout_centerHorizontal="true" >
</LinearLayout>
Since you're using RelativeLayouts and aligning your views beneath one another, it's likely that the layout is extending beyond the bottom of the screen.
I encourage you to use a different combination of ViewGroups, for instance using a vertically oriented LinearLayout inside a ScrollView.
Related
im trying to put a scroll view inside a frame layout. My scroll view is not scrolling all the way to bottom. this is my xml code. It is working when i give a padding to scroll view. but i need a better answer. because giving a padding will make a white margin below my application. Thank you!
<FrameLayout 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="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
// this is your first layout to put the big image
// use src or backgroud image as per requirement
<LinearLayout
android:background="#drawable/bg"
android:layout_width="match_parent"
android:layout_height="180dp">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/imageView"
android:background="#drawable/overly" />
</LinearLayout>
// this is your bottom layout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffc9c9c9"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:id="#+id/relativeLayout"
android:layout_marginTop="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Anna Huffmunster"
android:id="#+id/textView2"
android:textStyle="bold"
android:textSize="20dp"
android:gravity="center"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:paddingTop="40dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Colombo Sri lanka"
android:id="#+id/txt_location"
android:textSize="15dp"
android:gravity="center"
android:textStyle="italic"
android:textColor="#696969"
android:paddingBottom="7dp"
android:paddingTop="5dp"
android:layout_below="#+id/textView2"
android:layout_centerHorizontal="true" />
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/scrollView"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="fill_parent"
android:gravity="center_horizontal"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_below="#+id/relativeLayout"
android:layout_marginTop="12dp"
android:id="#+id/relativeLayout2">
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:id="#+id/imageButton"
android:background="#drawable/call_button"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:id="#+id/imageButton2"
android:background="#drawable/chat_button"
android:layout_alignParentTop="true"
android:layout_toStartOf="#+id/imageButton"
android:layout_marginRight="30dp" />
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:id="#+id/imageButton3"
android:background="#drawable/location_button"
android:layout_alignParentTop="true"
android:layout_toEndOf="#+id/imageButton"
android:layout_marginLeft="30dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/relativeLayout2"
android:layout_alignParentStart="true"
android:layout_marginTop="12dp"
android:id="#+id/relativeLayout3">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="“Live each day as if your life had just begun.” "
android:id="#+id/txt_status"
android:textColor="#ffd9162d"
android:textSize="12dp"
android:textStyle="italic"
android:gravity="center"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/relativeLayout3"
android:layout_alignParentStart="true">
<TextView
android:text="Birthday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView3"
android:textSize="12sp"
android:layout_marginStart="75dp"
android:layout_marginTop="23dp"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:textColor="#000" />
<TextView
android:text="19 MAR 1992"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView4"
android:inputType="date"
android:layout_marginEnd="79dp"
android:textSize="12sp"
android:layout_alignBaseline="#+id/textView3"
android:layout_alignBottom="#+id/textView3"
android:layout_alignParentEnd="true" />
<TextView
android:text="Profession"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView5"
android:layout_below="#+id/textView3"
android:layout_alignStart="#+id/textView3"
android:layout_marginTop="20dp"
android:textColor="#000"
android:textSize="12sp" />
<TextView
android:text="Software Engineer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView6"
android:textSize="12sp"
android:maxWidth="20dp"
android:layout_alignTop="#+id/textView5"
android:layout_alignStart="#+id/textView4"
android:layout_alignEnd="#+id/textView4" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true">
<TextView
android:text="dgsdfsdfdfsdfsdfvv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView8"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
<TextView
android:text="dgsdfsdfdfsdfsdfvv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView11"
android:layout_below="#+id/textView8"
android:layout_alignParentStart="true" />
<TextView
android:text="dgsdfsdfdfsdfsdfvv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView9"
android:layout_below="#+id/textView11"
android:layout_alignParentStart="true" />
<TextView
android:text="dgsdfsdfdfsdfsdfvv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView10"
android:layout_below="#+id/textView9"
android:layout_alignParentStart="true" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
// This is the imageview which overlay the first LinearLayout
<ImageView
android:layout_width="122dp"
android:layout_height="122dp"
android:src="#drawable/circle_profile_pic"
android:adjustViewBounds="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="100dp"
android:background="#drawable/stroke"/>
I am trying to align my buttons at the bottom of the screen using layouts but I cannot figure what's wrong with my code. I have tried several options by nesting different layouts but with no good outcome. it looks like this right now
And my code:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/ScrollView01"
android:layout_width="match_parent"
android:layout_height="match_parent">
<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:id="#+id/relLayout"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:clickable="true"
android:focusableInTouchMode="true"
tools:context="com.example.aurora.personalinformation.MainActivity">
<!-- Make the parent view clickable and focusable -->
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/title"
android:layout_centerHorizontal="true"
android:id="#+id/title"
android:textColor="#FF0000"
android:textSize="25dp"
android:textAlignment="center" />
<TextView
android:id="#+id/nameLable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/name"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="15dp"
android:layout_marginTop="40dp"
android:layout_below="#id/title"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<EditText android:id="#+id/edit_name"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter name"
android:layout_alignBottom="#id/nameLable"
android:layout_toRightOf="#+id/phoneLable"
android:layout_toEndOf="#+id/phoneLable"
/>
<TextView
android:id="#+id/addressLable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/address"
android:textColor="#000000"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignBottom="#+id/addressField"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<EditText
android:id="#+id/addressField"
android:layout_weight="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter your address"
android:layout_below="#id/edit_name"
android:layout_alignLeft="#id/edit_name"
android:layout_alignStart="#id/edit_name" />
<TextView
android:id="#+id/phoneLable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/phone"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="15dp"
android:layout_below="#id/addressField"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="20dp"/>
<EditText
android:id="#+id/phoneField"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter your phone number"
android:layout_below="#id/addressField"
android:layout_toRightOf="#id/phoneLable"
android:layout_toEndOf="#id/phoneLable" />
<TextView
android:id="#+id/emailLable"
android:layout_below="#id/phoneLable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/email"
android:textColor="#000000"
android:textSize="15dp"
android:textStyle="bold"
android:layout_marginTop="20dp"/>
<EditText
android:id="#+id/emailField"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter your email"
android:layout_below="#id/phoneField"
android:layout_alignLeft="#id/phoneField"
android:layout_alignStart="#id/phoneField" />
<TextView
android:id="#+id/genderLable"
android:layout_below="#id/emailLable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/gender"
android:layout_marginTop="20dp"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="15dp" />
<Spinner
android:id="#+id/gender"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:entries="#array/gender"
android:layout_alignTop="#+id/genderLable"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignLeft="#+id/emailField"
android:layout_alignStart="#+id/emailField" />
<TextView
android:id="#+id/country"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Country"
android:textColor="#000000"
android:textSize="15dp"
android:textStyle="bold"
android:layout_below="#id/gender"
android:layout_marginTop="15dp"/>
<AutoCompleteTextView
android:id="#+id/countryField"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter your email"
android:layout_below="#id/gender"
android:layout_toRightOf="#id/phoneLable"
android:layout_toEndOf="#id/phoneLable" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="bottom"
android:layout_alignParentBottom="true">
<Button
android:id="#+id/buttonSave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Send"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:id="#+id/buttonCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
just give your last RelativeLayout like this:
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="bottom"
android:layout_below="#+id/countryField"
android:layout_alignParentBottom="true">
<Button
android:id="#+id/buttonSave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Send"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:id="#+id/buttonCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
One more thing there is no meaning to give an orientation to RelativeLayout.
In my application i am using recycler view and scrollview in one layout. it is not working when i am using both these views. If i remove scroll view only the recycler view is working. Plese any one help me hoe to fix this issue.
my code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/r1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/background"
>
<ScrollView
android:id="#+id/sc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#1e356a">
<TextView
android:id="#+id/placce_head"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="Hyderabad to banglore"
android:textColor="#ffffff"
android:textSize="20dp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#78869c"
android:weightSum="2"
android:orientation="horizontal">
<TextView
android:id="#+id/seats"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:text="Selected Seats"
android:textColor="#ffffff"
android:textSize="16dp" />
<TextView
android:id="#+id/totalamount"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:text="Total Amount"
android:textColor="#ffffff"
android:textSize="16dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#78869c"
android:weightSum="2"
android:orientation="horizontal">
<TextView
android:id="#+id/seat_num"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:textColor="#ffffff"
android:textSize="16dp" />
<TextView
android:id="#+id/total_amount"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="10dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:textColor="#ffffff"
android:textSize="16dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:id="#+id/boardingpoint_edttxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="false"
android:layout_marginLeft="30dp"
android:layout_marginTop="22dp"
android:background="#null"
android:hint=" Select Boarding Point"
android:textColorHint="#1e365a"
android:textSize="15dp" />
<View
android:layout_width="fill_parent"
android:layout_height="0.8dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="7dp"
android:background="#1e365a" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#78869c"
android:layout_marginTop="20dp">
<TextView
android:id="#+id/contact_details"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="Contact Details"
android:textColor="#ffffff"
android:textSize="20dp" />
</RelativeLayout>
<EditText
android:id="#+id/contactname_edt_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="22dp"
android:background="#null"
android:hint="Contact Name"
android:textColorHint="#1e365a"
android:textSize="15dp" />
<View
android:layout_width="fill_parent"
android:layout_height="0.8dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="7dp"
android:background="#1e365a" />
<EditText
android:id="#+id/email_edt_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="22dp"
android:background="#null"
android:hint="Email Address"
android:textColorHint="#1e365a"
android:textSize="15dp" />
<View
android:layout_width="fill_parent"
android:layout_height="0.8dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="7dp"
android:background="#1e365a" />
<EditText
android:id="#+id/contactnum_edt_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="22dp"
android:background="#null"
android:hint="Contact Number"
android:textColorHint="#1e365a"
android:textSize="15dp" />
<View
android:layout_width="fill_parent"
android:layout_height="0.8dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="7dp"
android:background="#1e365a" />
<EditText
android:id="#+id/emergency_edt_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="22dp"
android:background="#null"
android:hint="Emergency Contact Number"
android:textColorHint="#1e365a"
android:textSize="15dp" />
<View
android:layout_width="fill_parent"
android:layout_height="0.8dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="7dp"
android:background="#1e365a" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#78869c"
android:layout_marginTop="20dp">
<TextView
android:id="#+id/passenger_details"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="Passenger Details"
android:textColor="#ffffff"
android:textSize="20dp" />
</RelativeLayout>
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/view"
android:layout_below="#+id/sc"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<LinearLayout
android:id="#+id/coupon_lay"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="8dp"
android:layout_marginTop="12dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="100" >
<EditText
android:id="#+id/entercouponcode_edt"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_weight="50"
android:hint="Enter coupn code"
android:inputType="text" >
<requestFocus />
</EditText>
<Button
android:id="#+id/bt_apply"
style="#style/payment_button_style"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginLeft="-5dp"
android:layout_weight="40"
android:gravity="center"
android:text="Apply" />
</LinearLayout>
<Button
android:id="#+id/pay_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="28dp"
android:layout_marginRight="30dp"
android:layout_marginTop="20dp"
android:background="#F93249"
android:duplicateParentState="true"
android:gravity="center"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:text="Proceed to Pay"
android:textColor="#ffffff"
android:textSize="20dp"/>
</LinearLayout>
</ScrollView>
</RelativeLayout>
you must know that ,your scrollview property is set as MatchParent ,which means it will fill the content view, so i suggest to set Height a real value such as 100dp, and it will work
You need to dynamically change the height of the recyclerview, depending on how many items you have.
int recyclerheight = height_per_item * adapterData.size();
recyclerView.getLayoutParams().height = recyclerheight;
The scroll view blocks the recyclerview from changing its height set in the xml, that's why you need to do it programically.
i have one RelativeLayout and i have some views(image and edittexts) and now i want to use scrollview.this is a my xml code
<RelativeLayout
android:id="#+id/relativeLayout2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_marginTop="70dp" >
<ImageView
android:id="#+id/loginbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/passwordfild"
android:layout_alignRight="#+id/passwordfild"
android:layout_below="#+id/passwordfild"
android:layout_marginTop="28dp"
android:background="#drawable/login"
android:textColor="#ffffff" />
<EditText
android:id="#+id/passwordfild"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/namefild"
android:layout_alignRight="#+id/namefild"
android:layout_centerVertical="true"
android:background="#drawable/edittextbackground"
android:ems="10"
android:hint="პაროლი"
android:inputType="textPassword"
android:paddingLeft="15dp"
android:textColorHint="#e2e0e0" >
<requestFocus />
</EditText>
<EditText
android:id="#+id/namefild"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/passwordfild"
android:layout_marginBottom="42dp"
android:layout_marginLeft="175dp"
android:layout_marginRight="175dp"
android:background="#drawable/edittextbackground"
android:ems="10"
android:hint="სახელი"
android:paddingLeft="15dp"
android:textColorHint="#e2e0e0" >
<requestFocus />
</EditText>
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/namefild"
android:layout_alignLeft="#+id/namefild"
android:layout_alignRight="#+id/namefild"
android:layout_marginBottom="100dp"
android:background="#drawable/icon" />
</RelativeLayout>
also i added
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="70dp" >
and i inserted my relative layout inside my scrollview but design has changed.i have no idea what am i doing wrong
if anyone knows solution please help me
use android:fillViewport="true" inside the ScrollView
do like this,
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/mainlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#E0FFFF" >
<TextView
android:id="#+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
android:text="Portal Trading Ltd."
android:textSize="18sp"
android:textStyle="italic" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/tvSackNo"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:text="Santa Sacks"
android:textSize="40sp" />
<Button
android:id="#+id/btnEdit"
android:layout_width="100dp"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginRight="21dp"
android:text="Edit"
android:textSize="25sp" />
<Button
android:id="#+id/btnConfirm"
android:layout_width="100dp"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="21dp"
android:text="Confirm"
android:textSize="21sp" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView2"
android:gravity="center"
android:text="Printed Name Details"
android:textSize="22sp" />
<TextView
android:id="#+id/tvExtraCharge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView3"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="Confirmation Page"
android:textSize="12sp" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/btnEdit"
android:layout_alignParentLeft="true"
android:layout_below="#+id/tvExtraCharge"
android:fillViewport="true"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/sackscontainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
I am having a weird issue that I am not sure how to fix. I have a RelativeLayout inside a ScrollView and this scrollView has it's height set to fill_parent. So does the RelativeLayout. Still, the contents are not filling the entire screen and it's going only to the wrap_content of the last layout inside this RelativeLayout.
Here is my code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.pontai"
android:id="#+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/relativeLayout2"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/relativeLayout3"
android:layout_alignParentTop="true"
android:layout_alignRight="#+id/relativeLayout5"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="How much points you have here:"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="#+id/textViewTotalPoints1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="120"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<RelativeLayout
android:id="#+id/relativeLayout4"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:layout_alignLeft="#+id/relativeLayout3"
android:layout_below="#+id/linearLayout1"
android:layout_marginTop="5dp"
android:layout_toLeftOf="#+id/textView7"
android:orientation="vertical" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="Ratings"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textViewPositivePoints"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceSmall" />
<ImageView
android:id="#+id/imageView2"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_below="#+id/textView3"
android:layout_toLeftOf="#+id/textView3"
android:src="#drawable/thumbs_up_focused" />
<TextView
android:id="#+id/textViewNegativePoints"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/textView3"
android:layout_centerVertical="true"
android:layout_marginRight="3dp"
android:text="22"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textViewNegativePoints"
android:layout_alignBottom="#+id/textViewNegativePoints"
android:layout_alignLeft="#+id/textView3"
android:layout_marginLeft="3dp"
android:text="33"
android:textAppearance="?android:attr/textAppearanceSmall" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignTop="#+id/imageView2"
android:layout_toRightOf="#+id/textViewNegativePoints"
android:src="#drawable/thumbs_down_focused" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/relativeLayout5"
android:layout_width="95dp"
android:layout_height="80dp"
android:layout_alignRight="#+id/relativeLayout3"
android:layout_alignTop="#+id/relativeLayout4"
android:layout_toRightOf="#+id/textView7"
android:orientation="vertical" >
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="Comments"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:src="#drawable/speech_bubble" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/relativeLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/relativeLayout4"
android:layout_centerHorizontal="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp" >
<TextView
android:id="#+id/textViewOfferName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="Offer Name"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textViewBusinessName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="35dp"
android:text="Business Name"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textViewBusinessAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="60dp"
android:text="Business Address"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textViewNull1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="80dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textViewTotalPoints"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textViewNull1"
android:layout_centerHorizontal="true"
android:text="0/0"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="#+id/buttonUseNow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textViewTotalPoints"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="#string/offer_details_use_now" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/buttonUseNow"
android:layout_marginTop="10dp"
android:text="#string/_terms_and_conditions_"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="#+id/textViewTermsConditions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView2"
android:layout_marginTop="2dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/relativeLayout5"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp"
android:text="e"
android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="invisible" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
Anyone have ideas of how I can make the RelativeLayout2 to have the same height as the ScrollView, meaning, I want it to reach the bottom of the screen?
Thanks and regards,
Felipe
I have faced this problem before. Just Use android:fillViewport="true" in your scrollview and it will fill up the screen.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >