Hi guys i have this layout...but if my phone is horizontal doesn't work the ScrollView
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="#+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/sfondomain" >
<ImageView
android:id="#+id/imageView0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:src="#drawable/icon_drawer" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="60dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_below="#+id/imageView0"
android:src="#drawable/homelogo" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<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="167dp"
android:textColor="#FFFFFF"
android:textStyle="bold|italic"
android:text="Prossimo Arrivo"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ListView
android:id="#+id/arrivi"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_below="#+id/tv1"
android:cacheColorHint="#00000000" />
<TextView
android:id="#+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="327dp"
android:textColor="#FFFFFF"
android:textStyle="bold|italic"
android:text="Prossima Partenza"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ListView
android:id="#+id/partenze"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_below="#+id/tv2"
android:cacheColorHint="#00000000" />
<ImageView
android:id="#+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:src="#drawable/info" />
</RelativeLayout>
</FrameLayout>
<ListView
android:id="#+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="#android:color/transparent"
android:dividerHeight="0dp"
android:background="#drawable/background" >
</ListView>
but i don't know how put a ScrollView.
The layout works fine but when my phone in landscape doesn't scroll
I tried this:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="#+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/sfondomain" >
<ImageView
android:id="#+id/imageView0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:src="#drawable/icon_drawer" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="60dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_below="#+id/imageView0"
android:src="#drawable/homelogo" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<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="167dp"
android:textColor="#FFFFFF"
android:textStyle="bold|italic"
android:text="Prossimo Arrivo"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ListView
android:id="#+id/arrivi"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_below="#+id/tv1"
android:cacheColorHint="#00000000" />
<TextView
android:id="#+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="327dp"
android:textColor="#FFFFFF"
android:textStyle="bold|italic"
android:text="Prossima Partenza"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ListView
android:id="#+id/partenze"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_below="#+id/tv2"
android:cacheColorHint="#00000000" />
<ImageView
android:id="#+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:src="#drawable/info" />
</RelativeLayout>
</FrameLayout>
<ListView
android:id="#+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="#android:color/transparent"
android:dividerHeight="0dp"
android:background="#drawable/background" >
</ListView>
</android.support.v4.widget.DrawerLayout>
</ScrollView>
This is a logcat http://paste.ubuntu.com/9697890/
Related
This is the rough design of my activity:
On the top is a RelativeLayout which contains an ImageView and a TextView. On the middle is a NestedScrollView which contains a RecyclerView and a CardView below it. And finally a Button on the bottom. Previously it's implemented in RelativeLayout, and works OK.
Then I change it into ConstraintLayout, like this:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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/myapp_main_bg"
tools:context=".activity.OrderConfirmationActivity">
<RelativeLayout
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:id="#+id/rlHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imgForkDish"
android:src="#drawable/ic_fork_dish"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginLeft="10dp"
android:layout_toRightOf="#id/imgForkDish"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="Starbucks Senayan City" />
</RelativeLayout>
<androidx.core.widget.NestedScrollView
app:layout_constraintBottom_toTopOf="#id/btnOrderNow"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toBottomOf="#id/rlHeader"
android:id="#+id/ns_recview_orders"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/rlHeader"
android:layout_marginBottom="20dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/recview_orders"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.cardview.widget.CardView
android:id="#+id/cvPay"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_below="#id/ns_recview_orders"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_marginTop="20dp"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="#+id/row01"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Payment Method"
android:id="#+id/tvLblPaymentMethod"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="e-wallet"
android:textStyle="bold"
android:layout_alignParentRight="true" />
</RelativeLayout>
<View
android:id="#+id/v01"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#id/row01"
android:layout_marginTop="10dp"
android:background="#android:color/darker_gray" />
<RelativeLayout
android:id="#+id/row02"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/v01"
android:layout_marginTop="10dp">
<TextView
android:id="#+id/tvLblTotalOrder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Total Order" />
<TextView
android:id="#+id/tvTotalOrder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true" />
</RelativeLayout>
<RelativeLayout
android:layout_marginTop="10dp"
android:id="#+id/row03"
android:layout_below="#id/row02"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Service Fee"
android:id="#+id/tvLblServiceFee"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:layout_alignParentRight="true" />
</RelativeLayout>
<RelativeLayout
android:layout_marginTop="10dp"
android:id="#+id/row04"
android:layout_below="#id/row03"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Total"
android:id="#+id/tvLblTotal"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/tvTotal"
android:layout_alignParentRight="true" />
</RelativeLayout>
<RelativeLayout
android:layout_marginBottom="20dp"
android:layout_marginTop="2dp"
android:id="#+id/row05"
android:layout_below="#id/row04"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Include Tax"
android:layout_alignParentRight="true" />
</RelativeLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<com.google.android.material.button.MaterialButton
android:id="#+id/btnOrderNow"
android:text="Order Now"
app:layout_constraintBottom_toBottomOf="parent"
android:backgroundTint="#color/myapp_blue_btn"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</androidx.constraintlayout.widget.ConstraintLayout>
The result is:
As you can see, the NestedScrollView isn't positioned below RelativeLayout, but instead overlaps it. How to fix this?
Remove this tag from NestedScrollView:
app:layout_constraintTop_toTopOf="parent"
It is overlapping the app:layout_constraintTop_toBottomOf="#id/rlHeader" tag.
I'm implementing a Recycler View in Android to create a list, but for some reason I see a space in between two elements, and I'm not able to pinpoint the error location. As to why is this happening, my guess is on the row element XML.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:cardview1="http://schemas.android.com/apk/res-auto"
android:id="#+id/row_top_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="#+id/pos_cv"
android:layout_width="match_parent"
android:layout_height="72dp"
android:clickable="true"
cardview1:cardCornerRadius="6dp"
cardview1:cardElevation="4dp"
cardview1:cardMaxElevation="6dp">
<TextView
android:id="#+id/manager1"
android:layout_width="220dp"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="15dp"
android:text="Store Manager/Branch"
android:textSize="14sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:orientation="horizontal">
<TextView
android:id="#+id/retail"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="30dp"
android:text="Abc Retail"
android:textSize="10sp" />
<View
android:layout_width="170dp"
android:layout_height="match_parent" />
<TextView
android:id="#+id/amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="25,000"
android:textColor="#color/colorDarkPink"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:id="#+id/address"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="50dp"
android:text="Abc Retail"
android:textSize="10sp" />
</android.support.v7.widget.CardView>
RecyclerView
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/list_view_header_ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:weightSum="5"
android:background="#color/colorDarkPink"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Top 3 Performers"
android:textStyle="bold"
android:textColor="#color/colorPrimaryLight"
android:layout_weight="3"
android:textSize="16sp"
android:lines="1"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sales"
android:textStyle="bold"
android:textColor="#color/colorPrimaryLight"
android:layout_weight="2"
android:textSize="16sp"
android:lines="1"
/>
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/performer_lv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#color/colorTransparent"
android:layout_marginTop="16dp"
android:dividerHeight="4dp"
/>
It is because of recycler view height. Try to change recyclerview height to wrap_content.And in cardview layout in linear-layout use height wrap_content.
try this code for your cardview:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:cardview1="http://schemas.android.com/apk/res-auto"
android:id="#+id/row_top_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="#+id/pos_cv"
android:layout_width="match_parent"
android:layout_height="72dp"
android:clickable="true"
android:layout_marginBottom="10dp"
cardview1:cardCornerRadius="6dp"
cardview1:cardElevation="4dp"
cardview1:cardMaxElevation="6dp">
<TextView
android:id="#+id/manager1"
android:layout_width="220dp"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="15dp"
android:text="Store Manager/Branch"
android:textSize="14sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:orientation="horizontal">
<TextView
android:id="#+id/retail"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="30dp"
android:text="Abc Retail"
android:textSize="10sp" />
<View
android:layout_width="170dp"
android:layout_height="match_parent" />
<TextView
android:id="#+id/amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="25,000"
android:textColor="#color/colorDarkPink"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:id="#+id/address"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="50dp"
android:text="Abc Retail"
android:textSize="10sp" />
</android.support.v7.widget.CardView>
</LinearLayout>
Try to decrease your values
android:layout_height="50dp"
if it will not work try to decrease values in other views
I have created a co-ordinator layout which has an Appcompat button placed at the bottom. I also have a relative layout inside that co-ordinator layout which is inside a nested scroll view. Output I am getting is like the fixed button overlaps the contents of the relative layout which does not let some of the elements inside the relative layout to be viewed. Please help me out guys!
Regards,
Thanks.`
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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/main_content"
android:clipToPadding="false"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context=".Hashmapretrieval"
app:contentScrim="#000000"
android:fitsSystemWindows="true"
app:statusBarBackground="#android:color/transparent"
android:background="#ffffff"
>
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="300dp"
android:fitsSystemWindows="true"
android:background="#000000"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="#000000"
android:background="#000000"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:id="#+id/imagev"
android:background="#000000"
android:fitsSystemWindows="true"
app:layout_collapseMode="parallax"
android:minHeight="100dp"/>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:layout_collapseMode="pin"
app:popupTheme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/ns"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:id="#+id/rr1"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:background="#ffffff"
android:fitsSystemWindows="true"
android:layout_alignParentBottom="true"
android:paddingBottom="#dimen/activity_vertical_margin"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:background="#ffffff">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text=""
android:textSize="15sp"
android:textColor="#000000"
android:id="#+id/placeid" />
<RelativeLayout
android:layout_width="match_parent"
android:id="#+id/rel1"
android:layout_height="0.3dp" android:background="#000000" android:layout_below="#+id/placeid" android:layout_marginTop="20dp">
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/rel3"
android:background="#ffffff"
android:layout_below="#+id/rel1"
android:layout_marginTop="10dp">
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/tablelayout"
android:layout_marginTop="10dp"
android:background="#ffffff">
<TableRow android:id="#+id/tableRow1"
android:layout_height="0dp"
android:layout_width="match_parent"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="17sp"
android:text="Teaching Skills"
android:id="#+id/QF"
android:layout_weight="3"
android:gravity="left"
android:padding="5dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="No Ratings"
android:textSize="17sp"
android:id="#+id/rate1"
android:gravity="center"
android:padding="5dp"
android:layout_weight="0"
/>
</TableRow>
<TableRow android:id="#+id/tableRow2"
android:layout_height="0dp"
android:layout_width="match_parent"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="17sp"
android:text="Classroom Culture"
android:layout_weight="3"
android:gravity="left"
android:padding="5dp"
android:id="#+id/QS"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="No Ratings"
android:textSize="17sp"
android:id="#+id/rate2"
android:layout_weight="0"
android:gravity="center"
android:padding="5dp"
/>
</TableRow>
<TableRow android:id="#+id/tableRow3"
android:layout_height="0dp"
android:layout_width="match_parent"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="17sp"
android:text="Syllabus Covered"
android:layout_weight="3"
android:gravity="left"
android:padding="5dp"
android:id="#+id/QT"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="No Ratings"
android:textSize="17sp"
android:id="#+id/rate3"
android:layout_weight="0"
android:gravity="center"
android:padding="5dp"
/>
</TableRow>
<TableRow android:id="#+id/tableRow4"
android:layout_height="0dp"
android:layout_width="match_parent"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="17sp"
android:text="Extra help when needed"
android:layout_weight="3"
android:gravity="left"
android:padding="5dp"
android:id="#+id/QFo"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="No Ratings"
android:textSize="17sp"
android:id="#+id/rate4"
android:layout_weight="0"
android:gravity="center"
android:padding="5dp"
/>
</TableRow>
<TableRow android:id="#+id/tableRow5"
android:layout_height="0dp"
android:layout_width="match_parent"
android:layout_gravity="center_vertical|center_horizontal|center"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="17sp"
android:layout_weight="3"
android:gravity="left"
android:padding="5dp"
android:text="Recommendations"
android:id="#+id/QFi"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="No Ratings"
android:textSize="17sp"
android:id="#+id/rate5"
android:layout_weight="0"
android:gravity="center"
android:padding="5dp"
/>
</TableRow>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0.3dp" android:background="#000000" android:layout_marginTop="10dp" android:layout_below="#+id/tr1">
</RelativeLayout>
<TableRow android:id="#+id/tableRow6"
android:layout_height="0dp"
android:layout_width="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="17sp"
android:layout_weight="3"
android:gravity="left"
android:padding="5dp"
android:text="Overall Ratings"
android:id="#+id/Or"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="No Ratings"
android:textSize="17sp"
android:id="#+id/rateo"
android:layout_weight="0"
android:gravity="center"
android:padding="5dp"
/>
</TableRow>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0.3dp" android:background="#000000" android:layout_marginTop="10dp" android:layout_below="#+id/tr2">
</RelativeLayout>
<TableRow
android:layout_height="0dp"
android:layout_width="match_parent" android:padding="15dp"
> </TableRow>
<TableRow android:id="#+id/tableRow7"
android:layout_height="0dp"
android:layout_width="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Fees:"
android:textSize="17sp"
android:id="#+id/tv1"
android:layout_weight="3"
android:gravity="left"
android:padding="5dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text=""
android:textSize="17sp"
android:id="#+id/fees"
android:layout_weight="0"
android:gravity="center"
android:padding="5dp"
/>
</TableRow>
<TableRow android:id="#+id/tableRow8"
android:layout_height="0dp"
android:layout_width="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Installment:"
android:textSize="17sp"
android:id="#+id/tv2"
android:layout_weight="3"
android:gravity="left"
android:padding="5dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text=""
android:id="#+id/instavl"
android:layout_below="#+id/fees"
android:layout_weight="0"
android:gravity="center"
android:textSize="17sp"
android:padding="5dp"
/>
</TableRow>
<TableRow android:id="#+id/tableRow9"
android:layout_height="0dp"
android:layout_width="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Duration:"
android:id="#+id/tv3"
android:layout_weight="3"
android:textSize="17sp"
android:gravity="left"
android:padding="5dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text=""
android:id="#+id/duration"
android:layout_weight="0"
android:textSize="17sp"
android:gravity="center"
android:padding="5dp"
/>
</TableRow>
<TableRow android:id="#+id/tableRow10"
android:layout_height="0dp"
android:layout_width="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Group Discount:"
android:textSize="17sp"
android:layout_weight="3"
android:gravity="left"
android:padding="5dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text=""
android:textSize="17sp"
android:id="#+id/groupdiscount"
android:layout_weight="0"
android:gravity="center"
android:padding="5dp"
/>
</TableRow>
<TableRow android:id="#+id/tableRow11"
android:layout_height="0dp"
android:layout_width="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="One Time Discount:"
android:textSize="17sp"
android:id="#+id/tv5"
android:layout_weight="3"
android:gravity="left"
android:padding="5dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text=""
android:textSize="17sp"
android:id="#+id/otpdiscount"
android:layout_weight="0"
android:gravity="center"
android:padding="5dp"
/>
</TableRow>
</TableLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:id="#+id/rr3"
android:layout_below="#+id/tablelayout">
<Button android:id="#+id/add_wishlist"
android:layout_height="#dimen/buttonheight"
android:layout_width="match_parent"
android:onClick="addtowishlist"
android:textAllCaps="false"
android:textSize="#dimen/buttonTextsize"
android:text="Add to my List"/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
<Button android:id="#+id/book_demo"
android:onClick="bookdemo"
android:layout_height="40dp"
android:clickable="true"
android:layout_width="match_parent"
android:layout_gravity="end|bottom" android:textColor="#ffffff"
android:textSize="#dimen/buttonTextsize"
android:textAllCaps="false"
android:text="Come for Demo Lecture"
android:background="#3b3b3b"
/>
</android.support.design.widget.CoordinatorLayout>
To hide/show FloatingActionButton there are different ways (and examples online), I like the way through a Behavior i.e. like this.
If you dont want the usual overlap, you can try adding a margin bottom of x dp (the eight of the button) to the NestedScrollView by:
android:layout_marginBottom="xdp"
Hey guys/girls Im creating a food tracker app for a class project. Where the user adds a spinner that has an array of items "food".
Problem: when the user adds 6 food in the breakfast section it over laps the next section which would be lunch. How would I fix this? I tried doing it in a listview but had problems.
content_main.xml
<ScrollView
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">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_horizontal_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context=".MainActivity"
tools:showIn="#layout/activity_main">
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="49dp"
android:text="#string/breakfast"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/textView2"
android:layout_marginTop="127dp"
android:text="Lunch"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView3"
android:layout_marginTop="130dp"
android:paddingBottom="130dp"
android:text="#string/dinner"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_alignRight="#+id/LLL"
android:layout_alignEnd="#+id/LLL"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<LinearLayout
android:id="#+id/BLL"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1"
android:layout_below="#+id/textView2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<Spinner
android:layout_width="240dp"
android:layout_height="37dp"
android:id="#+id/bkSpinner"
android:layout_weight="0.21"
android:entries="#array/allFoodItems" />
</LinearLayout>
<LinearLayout
android:id="#+id/LLL"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/addNewDItem"
android:layout_below="#+id/textView3"
android:orientation="vertical"
android:layout_centerHorizontal="true">
<Spinner
android:layout_width="240dp"
android:layout_height="37dp"
android:id="#+id/LSpinner"
android:layout_weight="0.21"
android:entries="#array/allFoodItems"/>
</LinearLayout>
<Button
android:id="#+id/addNewLItem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/textView3"
android:text="#string/LButton" />
<Button
android:id="#+id/addNewDItem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/textView4"
android:text="#string/DButton" />
<LinearLayout
android:id="#+id/DLL"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignBottom="#+id/textView4"
android:layout_alignEnd="#+id/LLL"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignRight="#+id/LLL"
android:orientation="vertical"
android:layout_below="#+id/addNewDItem">
<Spinner
android:layout_width="240dp"
android:layout_height="37dp"
android:id="#+id/dnSpinner"
android:entries="#array/allFoodItems" />
</LinearLayout>
<TextView
android:id="#+id/calories"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/total"
android:layout_alignEnd="#+id/addNewDItem"
android:layout_alignRight="#+id/addNewDItem"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#ff0000"
android:textSize="12dp"/>
<Button
android:id="#+id/total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/textView4"
android:text="#string/totalCal" />
<Button
android:id="#+id/addNewBItem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/BButton"
android:layout_column="13"
android:layout_alignTop="#+id/BLL"
android:layout_alignLeft="#+id/addNewDItem"
android:layout_alignStart="#+id/addNewDItem" />
</RelativeLayout>
design your xml 'row by row' using LinearLayout :
<ScrollView
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">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="BrekFast"
android:id="#+id/textView"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Spinner
android:layout_width="240dp"
android:layout_height="37dp"
android:id="#+id/bkSpinner"
android:layout_weight="0.21"
... />
<Button
android:text="Add Breakfast"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
... />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="BrekFast"
android:id="#+id/textView2"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Spinner
android:layout_width="240dp"
android:layout_height="37dp"
android:id="#+id/bkSpinner2"
android:layout_weight="0.21"
... />
<Button
android:text="Add Breakfast"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
... />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="BrekFast"
android:id="#+id/textView3"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Spinner
android:layout_width="240dp"
android:layout_height="37dp"
android:id="#+id/bkSpinner3"
android:layout_weight="0.21"
... />
<Button
android:text="Add Breakfast"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
... />
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Calories Total"/>
</LinearLayout>
</ScrollView>
I have a layout and I want the last LinearLayout to be aligned on the very bottom. I attempted to set the gravity and the android:layout_marginbottom=0dp and neither one seems to align it to the bottom.
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/item_detail_container"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".ItemDetailActivity" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="154dp" >
<ImageView
android:id="#+id/albumArt"
android:layout_width="140dp"
android:layout_height="138dp"
android:src="#drawable/stealyourface" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="fill_horizontal|center"
android:orientation="vertical" >
<TextView
android:id="#+id/artistName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingLeft="#dimen/TwentyPixels"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#E6E6E6" />
<TextView
android:id="#+id/showLocation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="#dimen/TwentyPixels"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#E6E6E6" />
<TextView
android:id="#+id/showDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="#dimen/TwentyPixels"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#E6E6E6" />
<TextView
android:id="#+id/runningSong"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="#dimen/TwentyPixels"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#E6E6E6" />
</LinearLayout>
<TextView
android:id="#+id/currentlyPlaying"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="#dimen/TwentyPixels"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#E6E6E6" />
</LinearLayout>
<ScrollView
android:id="#+id/ScrollView01"
android:layout_width="match_parent"
android:layout_height="214dp"
android:background="#000000" >
<LinearLayout
android:id="#+id/songList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
<!-- Player Buttons -->
**<LinearLayout
android:id="#+id/LinearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="horizontal"
android:layout_marginBottom="0dp">
<RelativeLayout
android:layout_width="320dp"
android:layout_height="wrap_content"
android:background="#layout/rounded_corner"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
<!-- Previous Button -->
<!-- Backward Button -->
<!-- Play Button -->
<ImageButton
android:id="#+id/btnPlay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/btnNext"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/btnBackward"
android:background="#null"
android:src="#drawable/btn_play" />
<!-- Forward Button -->
<!-- Next Button -->
<ImageButton
android:id="#+id/btnPrevious"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/btnPlay"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="#null"
android:src="#drawable/btn_previous" />
<ImageButton
android:id="#+id/btnBackward"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/btnPrevious"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/btnPrevious"
android:background="#null"
android:src="#drawable/btn_backward" />
<ImageButton
android:id="#+id/btnNext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="false"
android:layout_alignTop="#+id/btnForward"
android:layout_centerVertical="true"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/btnForward"
android:background="#null"
android:src="#drawable/btn_next" />
<ImageButton
android:id="#+id/btnForward"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/btnPlay"
android:background="#null"
android:src="#drawable/btn_forward" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>**
You have to use android:layout_gravity to do that, not android:gravity.
http://developer.android.com/reference/android/widget/FrameLayout.html
layout_gravity specifies the gravity in respect to the parent, gravity controls the placement of the content in the view itself.
You should take a relative layout as inner layout of linear layout. Like this example. I hope its useful for you.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/mainact"
android:weightSum="6" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/imageView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:clickable="true"
android:onClick="func"
android:src="#drawable/somnath" />
<ImageView
android:id="#+id/imageView20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:clickable="true"
android:onClick="func"
android:src="#drawable/ghrishneshwar" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="10dp"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="#+id/imageView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="10dp"
android:clickable="true"
android:onClick="func"
android:src="#drawable/mallikarjun" />
<ImageView
android:id="#+id/imageView19"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:clickable="true"
android:onClick="func"
android:src="#drawable/kedarnath" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="10dp"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/imageView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="20dp"
android:clickable="true"
android:onClick="func"
android:src="#drawable/mahakaleshwar" />
<ImageView
android:id="#+id/imageView18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="20dp"
android:clickable="true"
android:onClick="func"
android:src="#drawable/trayambkeshwar" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="10dp"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/imageView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="50dp"
android:clickable="true"
android:onClick="func"
android:src="#drawable/omkareshwar" />
<ImageView
android:id="#+id/imageView17"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="50dp"
android:clickable="true"
android:onClick="func"
android:src="#drawable/kashim" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="5dp"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/imageView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="90dp"
android:clickable="true"
android:onClick="func"
android:src="#drawable/vaidyanath" />
<ImageView
android:id="#+id/imageView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="90dp"
android:clickable="true"
android:onClick="func"
android:src="#drawable/nageshwar" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="5dp"
android:layout_marginRight="20dp"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/imageView14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="170dp"
android:clickable="true"
android:onClick="func"
android:src="#drawable/bhimashankar" />
<ImageView
android:id="#+id/imageView15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="170dp"
android:clickable="true"
android:onClick="func"
android:src="#drawable/rameshwaram" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>