android - Align Relative Layout at bottom of Linear Layout in Parent -


i have linear layout acts parent of relative layout.the relative layout consists of buttons , stuff.i want align relative layout(panel containing buttons) @ bottom of linear layout.the linear layout consists of imageview , after relative layout should aligned @ bottom.

but when try set android:layout_alignparentbottom="true" in relative layout ide prompts code wrong.how can achieve please help

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:gravity="center_horizontal"     android:orientation="vertical" >      <imageview         android:id="@+id/imageview1"         android:layout_width="fill_parent"         android:layout_height="250dp"         android:scaletype="fitstart"         android:src="@drawable/jellyfish" />      <relativelayout          android:layout_width="318dp"         android:layout_height="164dp"         android:layout_margin="5dp"         android:background="@drawable/backgrad"         android:orientation="vertical" >          <button             android:id="@+id/button1"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_alignparentbottom="true"             android:layout_marginbottom="20dp"             android:layout_marginleft="34dp"             android:onclick="clickme"             android:text="button" />          <imagebutton             android:id="@+id/imagebutton1"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_alignparenttop="true"             android:layout_margintop="16dp"             android:layout_toleftof="@+id/button1"             android:onclick="textclick"             android:src="@drawable/text" />          <button             android:id="@+id/button2"             style="?android:attr/buttonstylesmall"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_alignbaseline="@+id/button1"             android:layout_alignbottom="@+id/button1"             android:layout_centerhorizontal="true"             android:onclick="wmark"             android:text="save" />       </relativelayout>  </linearlayout> 

enter image description here

possible duplicate : how achieve alignparentbottom="true" property in linearlayout

when set android:layout_alignparentbottom="true", trying use methods of linearlayout. linearlayout not provide alignparentbottom.

the answer in duplicate says replace

android:layout_alignparentbottom="true" 

by

android:gravity="bottom" 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -