I have a little bit issue here.
layout which i have been designed in photoshop looks like below
and the layout which i design in xml look like below:
So, you see that for some reason, the edittexts look very off.here is the full XML code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#1fed7b">
<LinearLayout
android:orientation="vertical"
android:gravity="center"
android:layout_weight="114"
android:layout_width="match_parent"
android:layout_height="0dp">
<ImageButton
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/txt_headline" />
</LinearLayout>
<LinearLayout
android:gravity="top"
android:orientation="horizontal"
android:layout_weight="281"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="44"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="top"
android:orientation="vertical"
android:layout_weight="547"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/txt_subline1" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="44"
android:layout_width="0dp"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="20"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="10"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="10"
android:layout_width="0dp"
android:layout_height="wrap_content">
<EditText
android:id="#+id/txt_hours"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:gravity="center"
android:hint="00"
android:inputType="number"
android:maxLength="2"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="55sp" />
<TextView
android:text=":"
android:layout_gravity="top"
android:gravity="center_vertical"
android:id="#+id/txt_colon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="55sp" />
<EditText
android:id="#+id/txt_minutes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:gravity="center_vertical"
android:hint="00"
android:inputType="number"
android:maxLength="2"
android:singleLine="true"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="55sp" />
<LinearLayout
android:gravity="left"
android:orientation="horizontal"
android:layout_weight="10"
android:layout_width="0dp"
android:layout_height="match_parent">
<TextView
android:text="00"
android:layout_gravity="left"
android:gravity="bottom"
android:id="#+id/txt_seconds"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="189"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="160"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="top"
android:orientation="vertical"
android:layout_weight="140"
android:layout_width="0dp"
android:layout_height="match_parent">
<TextView
android:text="hh"
android:layout_gravity="left"
android:gravity="top"
android:id="#+id/txt_hh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="110"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="top"
android:orientation="vertical"
android:layout_weight="140"
android:layout_width="0dp"
android:layout_height="match_parent">
<TextView
android:text="mm"
android:layout_gravity="right"
android:gravity="top"
android:id="#+id/txt_mm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="160"
android:layout_width="0dp"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="250"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="314"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_playstore"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_playstore" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_random"
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_random" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="15"
android:layout_width="match_parent"
android:layout_height="0dp" />
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="314"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_facebook"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_fb" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_start"
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_start" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="209"
android:layout_width="match_parent"
android:layout_height="0dp">
<ImageButton
android:id="#+id/btn_skip"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_skip" />
</LinearLayout>
</LinearLayout>
I know, it is a lot of code, but I really need your help here. Can you do me a favor and look through it? That be so awesome!!!
Thank you!
here is solution for your problem,copy and past code.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#1fed7b">
<LinearLayout
android:orientation="vertical"
android:gravity="center"
android:layout_weight="114"
android:layout_width="match_parent"
android:layout_height="0dp">
<ImageButton
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/txt_headline" />
</LinearLayout>
<LinearLayout
android:gravity="top"
android:orientation="horizontal"
android:layout_weight="281"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="44"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="top"
android:orientation="vertical"
android:layout_weight="547"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/txt_subline1" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="44"
android:layout_width="0dp"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="20"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="90dp"
android:layout_height="match_parent"
android:orientation="vertical"></LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="#+id/txt_hours"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:hint="00"
android:inputType="number"
android:maxLength="2"
android:layout_weight="1"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="55sp" />
<TextView
android:id="#+id/txt_colon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="top"
android:gravity="center"
android:text=":"
android:layout_weight="2"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="55sp" />
<EditText
android:id="#+id/txt_minutes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:layout_weight="1"
android:hint="00"
android:gravity="right"
android:inputType="number"
android:maxLength="2"
android:singleLine="true"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="55sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top"
android:orientation="horizontal">
<TextView
android:id="#+id/txt_mm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:text="mm"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="20sp" />
<TextView
android:id="#+id/txt_hh"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="right"
android:text="hh"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="90dp"
android:layout_height="match_parent"
>
<TextView
android:id="#+id/txt_seconds"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="00"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="250"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="314"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_playstore"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_playstore" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_random"
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_random" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="15"
android:layout_width="match_parent"
android:layout_height="0dp" />
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="314"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_facebook"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_fb" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_start"
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_start" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="209"
android:layout_width="match_parent"
android:layout_height="0dp">
<ImageButton
android:id="#+id/btn_skip"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_skip" />
</LinearLayout>
</LinearLayout>
hope this will solve your problem
Related
I am trying to create layout like below in android:
But my problem is I am unable to add textbelow the image or on the right hand side of imageview. If I wrap ImageView and textview in a LinearLayout the then the whole view shrinks. Should I be using TableLayout?
My current layout xml is like below:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_below="#id/my_recycler_view"
android:layout_margin="30dp">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="300dp"
android:orientation="vertical"
android:layout_weight="1"
>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/vwImageAndClassroom"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
>
<ImageView
android:id="#+id/img_room"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:contentDescription="#string/coverimage_contentdescription"
android:scaleType="fitCenter"
android:src="#drawable/comm_book_icon"
/>
<TextView
android:id="#+id/tv_emp_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:textSize="12dp"
android:textStyle="bold"
android:textAllCaps="true"
android:layout_below="#id/img_room"
android:layout_marginBottom="20dp"
android:gravity="center_horizontal"
android:text="TEXT 1"
/>
</RelativeLayout>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="300dp"
android:orientation="vertical"
android:layout_weight="1"
>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/vwImageAndClassroom2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
>
<ImageView
android:id="#+id/img_room2"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:contentDescription="#string/coverimage_contentdescription"
android:scaleType="fitCenter"
android:src="#drawable/visitor_book_icon"
/>
<TextView
android:id="#+id/tv_emp_name2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:textSize="12dp"
android:textStyle="bold"
android:textAllCaps="true"
android:layout_below="#id/img_room2"
android:layout_marginBottom="20dp"
android:gravity="center_horizontal"
android:text="TEXT 2"
/>
</RelativeLayout>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="300dp"
android:orientation="vertical"
android:layout_weight="1"
>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/vwImageAndClassroom3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
>
<ImageView
android:id="#+id/img_room3"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:contentDescription="#string/coverimage_contentdescription"
android:scaleType="fitCenter"
android:src="#drawable/visitor_book_icon"
/>
<TextView
android:id="#+id/tv_emp_name3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:textSize="12dp"
android:textStyle="bold"
android:textAllCaps="true"
android:layout_below="#id/img_room3"
android:layout_marginBottom="20dp"
android:gravity="center_horizontal"
android:text="TEXT 3"
/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
Hope this will help you and you will find your solutions from this xml code. I just modify some of your code
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="#+id/image1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:src="#android:drawable/ic_search_category_default"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This Right side text 1"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:src="#android:drawable/ic_search_category_default"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This Right side text 1"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:src="#android:drawable/ic_search_category_default"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This Right side text 1"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="This is under layout text"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="This is under layout text"/>
</LinearLayout>
</LinearLayout>
Have placeholder views where text is not required.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#color/next_green" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#color/next_green" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#color/next_green" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="text"/>
</LinearLayout>
</LinearLayout>
I did exactly what you want
Open image
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="#android:drawable/btn_dialog" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView3"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="#android:drawable/btn_dialog" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView2"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="#android:drawable/btn_dialog" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="#+id/textView5"
android:layout_width="match_parent"
android:layout_height="15dp"
android:text="Some text" />
<TextView
android:id="#+id/textView6"
android:layout_width="match_parent"
android:layout_height="15dp"
android:text="Some text" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView7"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Some text"
app:srcCompat="#android:drawable/btn_dialog" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="#+id/textView8"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Some text"
app:srcCompat="#android:drawable/btn_dialog" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="#+id/textView9"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Some text"
app:srcCompat="#android:drawable/btn_dialog" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
I am trying to set my list view when I click on image, it should be hidden or shown but the problem is that when I inflate my list view in my activity, it is hiding behind and not taking complete space. When I perform on click event it opens behind the parent layout.
SNAPSHOT
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical"
tools:context="com.bitblue.dextronewproject.Avtivity.ReportActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/main_linear_layout">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="Fees History"
android:textSize="20sp"
android:typeface="monospace" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="5dp"
android:background="#color/studentlogin" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Receipt"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Amount"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Date"
android:typeface="monospace" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_2"
android:layout_below="#+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TableLayout
android:id="#+id/r_tablelayoutRAD"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
</TableLayout>
<ImageView
android:id="#+id/drop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5.5"
android:src="#drawable/ic_drop_down_round_button" />
</LinearLayout>
<ListView
android:layout_below="#id/ll_2"
android:id="#+id/lisstview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
</ListView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Unpaid"
android:textSize="20sp"
android:typeface="monospace" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="30dp"
android:text="Type"
android:textSize="15dp"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="30dp"
android:text="Amount"
android:textSize="15dp"
android:typeface="monospace" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="5dp"
android:background="#color/studentlogin" />
<ListView
android:layout_width="match_parent"
android:id="#+id/un_paid_list_view"
android:layout_height="wrap_content">
</ListView>
</LinearLayout>
</RelativeLayout>
Your effort is appreciable.Thanks in andvance
Your parent layouts are not matching. You have used layout_below in LinearlLayout where the parent is not RelativeLayout. Check the hierarchy of the layouts in your layout.
Try this:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical"
tools:context="com.bitblue.dextronewproject.Avtivity.ReportActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Fees History"
android:textSize="20sp"
android:typeface="monospace"
android:id="#+id/textView1"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="5dp"
android:background="#color/studentlogin"
android:layout_below="#+id/textView1"
android:id="#+id/view1"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="#+id/view1"
android:id="#+id/ll1">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Receipt"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Amount"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Date"
android:typeface="monospace" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_2"
android:layout_below="#+id/ll1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TableLayout
android:id="#+id/r_tablelayoutRAD"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
</TableLayout>
<ImageView
android:id="#+id/drop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5.5"
android:src="#drawable/ic_drop_down_round_button" />
</LinearLayout>
<ListView
android:layout_below="#+id/ll_2"
android:id="#+id/lisstview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Unpaid"
android:textSize="20sp"
android:typeface="monospace"
android:layout_below="#+id/lisstview"
android:id="#+id/textView2"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="#+id/textView2"
android:id="#+id/ll3">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="30dp"
android:text="Type"
android:textSize="15dp"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="30dp"
android:text="Amount"
android:textSize="15dp"
android:typeface="monospace" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="5dp"
android:background="#color/studentlogin"
android:layout_below="#+id/ll3"
android:id="#+id/view3"/>
<ListView
android:layout_width="match_parent"
android:id="#+id/un_paid_list_view"
android:layout_height="wrap_content"
android:layout_below="#+id/ll3"/>
my xml layout is working fine, everything coming in single screen no need to scroll in below 5.5 screens
but in 5.5 not able to see all thing in single screen i have to scroll to see remaining content that is two buttons showing bottom `
This is the screenshot.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/layout_container"
android:layout_marginBottom="20dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/left_p"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="20dp"
android:src="#drawable/left_arrow" />
<TextView
android:id="#+id/date_p"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="5"
android:gravity="center_horizontal"
android:paddingLeft="60dp"
android:paddingRight="60dp"
android:text="Monday, 24 August, 2015"
android:textColor="#color/White" />
<ImageView
android:id="#+id/right_p"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="20dp"
android:src="#drawable/right_arrow" />
</LinearLayout>
<LinearLayout
android:id="#+id/layout_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_marginTop="2dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/morning_layout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="1"
android:background="#drawable/inactive_box"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal"
android:paddingBottom="10dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:orientation="vertical">
<ImageView
android:id="#+id/morning_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/morning_icon" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:orientation="vertical">
<TextView
android:id="#+id/morning"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Morning"
android:textColor="#color/SlateGray" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical">
<LinearLayout
android:id="#+id/tab_list1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="20dp"
android:orientation="horizontal">
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/noon_layout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="1"
android:background="#drawable/inactive_box"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:orientation="vertical">
<ImageView
android:id="#+id/noon_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/noon_icon" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:orientation="vertical">
<TextView
android:id="#+id/noon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Noon"
android:textColor="#color/SlateGray" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical">
<LinearLayout
android:id="#+id/tab_list2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="20dp"
android:orientation="horizontal">
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/evening_layout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="1"
android:background="#drawable/inactive_box"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal"
android:paddingBottom="6dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:orientation="vertical">
<ImageView
android:id="#+id/evening_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/evening_icon" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:orientation="vertical">
<TextView
android:id="#+id/evening"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Evening"
android:textColor="#color/SlateGray" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical">
<LinearLayout
android:id="#+id/tab_list3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="20dp"
android:orientation="horizontal">
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/night_layout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="1"
android:background="#drawable/inactive_box"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:orientation="vertical">
<ImageView
android:id="#+id/night_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/night_icon" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:orientation="vertical">
<TextView
android:id="#+id/night"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Night"
android:textColor="#color/SlateGray" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical">
<LinearLayout
android:id="#+id/tab_list4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="20dp"
android:orientation="horizontal">
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:gravity="left"
android:orientation="vertical">
<ImageView
android:id="#+id/pillbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="7dp"
android:background="#drawable/pill_box_icon" />
<TextView
android:id="#+id/pill_box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pill Box"
android:textColor="#color/White"
android:textSize="13dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:gravity="right"
android:orientation="vertical">
<ImageView
android:id="#+id/plus_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#drawable/plus_icon" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
I have tested my application in genymotion emulator using two Android OSs. Lollipop and Ice Cream Sandwich. Worked fine in both devices. Problem is when I tested in real devices, item positions and sizes get changed.
In my xiomi mi4c (lollipop) screen looks ok
But in micromax canves (Ice Cream Sandwich) this problem happens
I want my app look like the same as in my mi4c in every devices.
This is my xml file.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout 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/drawer_layout_widget"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/bg_register"
android:orientation="vertical"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="com.ceatkelanisrilanka.dushanmadushanka.ceat.CeatMainActivity"
tools:showIn="#layout/activity_ceat_main">
<include
android:id="#+id/app_bar"
layout="#layout/app_toolbar_welcome_menu"></include>
<LinearLayout
android:id="#+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/firstLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="5dp">
<LinearLayout
android:id="#+id/enMonth"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingStart="10dp">
<TextView
android:id="#+id/txtMonth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Month"
android:textColor="#ffffff"
android:textSize="24sp" />
<TextView
android:id="#+id/yearTextV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="year"
android:layout_gravity="center"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#ffffff" />
</LinearLayout>
<LinearLayout
android:id="#+id/pViewLayout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<com.rey.material.widget.ProgressView
android:id="#+id/pViewew"
cpd_strokeColor="#android:color/holo_red_dark"
cpd_strokeSecondaryColor="#android:color/holo_blue_bright"
cpd_strokeSize="25dp"
android:layout_width="50dp"
android:layout_height="50dp"
app:pv_autostart="true"
app:pv_circular="true"
app:pv_progressMode="indeterminate"
app:pv_progressStyle="#style/Material.Drawable.CircularProgress" />
</LinearLayout>
<LinearLayout
android:id="#+id/snMonthLayout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical"
android:paddingEnd="10dp"
android:paddingRight="10dp">
<TextView
android:id="#+id/txtMonthSn"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="MonthSn"
android:textColor="#ffffff"
android:textSize="24sp" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:id="#+id/secondLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="15dp">
<com.github.lzyzsd.circleprogress.ArcProgress
android:id="#+id/arc_progress"
android:layout_width="220dp"
android:layout_height="220dp"
android:layout_marginLeft="15dp"
android:layout_marginStart="15dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="center"
android:orientation="vertical"
android:paddingRight="15dp"
android:paddingTop="25dp">
<com.hookedonplay.decoviewlib.DecoView
android:id="#+id/dynamicArcView"
android:layout_width="100dp"
android:layout_height="100dp"
android:padding="5dp" />
<TextView
android:id="#+id/pView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0 %"
android:textColor="#4B73C4"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Precentage"
android:textColor="#4B73C4"
android:textSize="15sp" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/thirdLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingTop="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/txtMtar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Monthly Target"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/txtMAch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Achievment"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/txtPre"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Percentage"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.1"
android:orientation="vertical"
android:paddingTop="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="#+id/txtTarget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="M"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="#+id/txtAchievement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="M"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="#+id/txtCollection"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="M"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:paddingTop="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="#+id/bTon"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Ton"
android:textColor="#color/border_gray" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="#+id/bValue"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Value"
android:textColor="#color/border_gray" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="#+id/bCollection"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Collection"
android:textColor="#color/border_gray" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<fragment
android:id="#+id/fragment_navigation_drawer"
android:name="com.ceatkelanisrilanka.dushanmadushanka.ceat.fragments.NavigationDrawerFragment"
android:layout_width="#dimen/nav_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout="#layout/fragment_navigation_drawer"
tools:layout="#layout/fragment_navigation_drawer"></fragment>
</android.support.v4.widget.DrawerLayout>
Try This:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/drawer_layout_widget"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ff0000"
android:orientation="vertical"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<include
android:id="#+id/app_bar"
layout="#layout/app_toolbar_welcome_menu"></include>
<LinearLayout
android:id="#+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/firstLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="5dp">
<LinearLayout
android:id="#+id/enMonth"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingStart="10dp">
<TextView
android:id="#+id/txtMonth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Month"
android:textColor="#ffffff"
android:textSize="24sp" />
<TextView
android:id="#+id/yearTextV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="year"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#ffffff" />
</LinearLayout>
<LinearLayout
android:id="#+id/pViewLayout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<com.rey.material.widget.ProgressView
android:id="#+id/pViewew"
cpd_strokeColor="#android:color/holo_red_dark"
cpd_strokeSecondaryColor="#android:color/holo_blue_bright"
cpd_strokeSize="25dp"
android:layout_width="50dp"
android:layout_height="50dp"
app:pv_autostart="true"
app:pv_circular="true"
app:pv_progressMode="indeterminate"
app:pv_progressStyle="#style/Material.Drawable.CircularProgress" />
</LinearLayout>
<LinearLayout
android:id="#+id/snMonthLayout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical"
android:paddingEnd="10dp"
android:paddingRight="10dp">
<TextView
android:id="#+id/txtMonthSn"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="MonthSn"
android:textColor="#ffffff"
android:textSize="24sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/secondLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:padding="5dp">
<com.github.lzyzsd.circleprogress.ArcProgress
android:id="#+id/arc_progress"
android:layout_width="220dp"
android:layout_height="220dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_weight=".5"
android:gravity="center"
android:layout_gravity="center_vertical"
android:orientation="vertical"
android:padding="5dp">
<com.hookedonplay.decoviewlib.DecoView
android:id="#+id/dynamicArcView"
android:layout_width="100dp"
android:layout_height="100dp"
android:padding="5dp" />
<TextView
android:id="#+id/pView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0 %"
android:textColor="#4B73C4"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Precentage"
android:textColor="#4B73C4"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/thirdLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:padding="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingTop="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/txtMtar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Monthly Target"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/txtMAch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Achievment"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/txtPre"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Percentage"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:paddingTop="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="#+id/txtTarget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="M"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="#+id/txtAchievement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="M"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="#+id/txtCollection"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="M"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:paddingTop="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="#+id/bTon"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Ton"
android:textColor="#000000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="#+id/bValue"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Value"
android:textColor="#000000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="#+id/bCollection"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Collection"
android:textColor="#000000" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!--<fragment
android:id="#+id/fragment_navigation_drawer"
android:name="com.ceatkelanisrilanka.dushanmadushanka.ceat.fragments.NavigationDrawerFragment"
android:layout_width="#dimen/nav_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout="#layout/fragment_navigation_drawer"
tools:layout="#layout/fragment_navigation_drawer"></fragment>-->
</android.support.v4.widget.DrawerLayout>
I am unable to place a layout at the bottom after a scroll view. Please help.
This is my code:
<?xml version="1.0" encoding="utf-8"?>
<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="fill_parent" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp">
<android.support.v7.widget.RecyclerView
android:id="#+id/my_recycler_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fadingEdgeLength="0dp"
android:overScrollMode="never"
android:scrollbars="horizontal" />
<LinearLayout
android:id="#+id/bottom"
android:layout_width="match_parent"
android:layout_height="30dp"
android:orientation="horizontal"
android:gravity="bottom">
<LinearLayout
android:id="#+id/linear_call"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:orientation="vertical"
android:gravity="center"
android:padding="8dp"
android:background="#drawable/list_selector">
<ImageView
android:id="#+id/btn_phone_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/call_us_tab"/>
<TextView
android:id="#+id/call"
android:textColor="#android:color/white"
android:text="Call Us"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#5488B8" />
<LinearLayout
android:id="#+id/linear_message"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:orientation="vertical"
android:gravity="center"
android:padding="8dp"
android:background="#drawable/list_selector"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/message_tab"
/>
<TextView
android:id="#+id/msg"
android:textColor="#android:color/white"
android:text="Message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#5488B8" />
<LinearLayout
android:id="#+id/linear_share"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:orientation="vertical"
android:gravity="center"
android:background="#drawable/list_selector"
android:padding="8dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/share_tab"/>
<TextView
android:id="#+id/share"
android:textColor="#android:color/white"
android:text="Share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fadingEdgeLength="0dp"
android:padding="5dp"
android:fillViewport="true"
android:overScrollMode="never"
android:scrollbars="none"
android:layout_above="#+id/bottom">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="#+id/tv_name_detail_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textStyle="bold"
android:layout_marginTop="5dp"/>
<TextView
android:id="#+id/tv_map"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Show Map"
android:singleLine="true"
android:textStyle="bold"
android:layout_marginTop="5dp"/>
</RelativeLayout>
<TextView
android:id="#+id/tv_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<RatingBar
android:layout_marginTop="2dp"
android:id="#+id/rating_bar_pro_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
style="#style/foodRatingBar"/>
<TextView
android:id="#+id/tv_nearby"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp" />
<TextView
android:layout_marginTop="5dp"
android:id="#+id/tv_specialization"
android:text="Specialization: "
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<ListView
android:id="#+id/list_specialization"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textStyle="bold"
android:layout_marginTop="5dp"
android:id="#+id/tv_education"
android:text="Education:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ListView
android:id="#+id/list_education"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textStyle="bold"
android:id="#+id/tv_experiences"
android:layout_marginTop="5dp"
android:text="Experiences:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ListView
android:id="#+id/list_experience"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
<!-- The navigation drawer -->
<ListView android:id="#+id/left_drawer"
android:layout_width="260dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="#5488B8"
android:dividerHeight="1dp"
android:background="#00427F"
android:listSelector="#drawable/list_selector"
/>
</android.support.v4.widget.DrawerLayout>
Try like this, this will fix your problem.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.RecyclerView
android:id="#+id/my_recycler_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:fadingEdgeLength="0dp"
android:overScrollMode="never"
android:scrollbars="horizontal" />
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/bottom"
android:layout_below="#+id/my_recycler_view"
android:fadingEdgeLength="0dp"
android:fillViewport="true"
android:overScrollMode="never"
android:padding="5dp"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="#+id/bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="bottom"
android:orientation="horizontal">
</LinearLayout>
</RelativeLayout>
Use root layout as RelativeLayout and the view you want to align bottom that's add this line:
android:layout_alignParentBottom="true"
This will solve your issue.
Try this and give your scroll view any variable size rather than wrap_content
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="#+id/my_recycler_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fadingEdgeLength="0dp"
android:overScrollMode="never"
android:scrollbars="horizontal" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fadingEdgeLength="0dp"
android:padding="5dp"
android:fillViewport="true"
android:overScrollMode="never"
android:scrollbars="none"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/tv_name_detail_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textStyle="bold"
android:layout_marginTop="5dp"
/>
<TextView
android:id="#+id/tv_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<RatingBar
android:layout_marginTop="2dp"
android:id="#+id/rating_bar_pro_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
style="#style/foodRatingBar"
/>
<TextView
android:id="#+id/tv_nearby"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
/>
<TextView
android:layout_marginTop="5dp"
android:id="#+id/tv_specialization"
android:text="Specialization: "
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<ListView
android:layout_marginTop="5dp"
android:id="#+id/list_specialization"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textStyle="bold"
android:layout_marginTop="5dp"
android:id="#+id/tv_education"
android:text="Education:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ListView
android:layout_marginTop="5dp"
android:id="#+id/list_education"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textStyle="bold"
android:id="#+id/tv_experiences"
android:layout_marginTop="5dp"
android:text="Experiences:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ListView
android:layout_marginTop="5dp"
android:id="#+id/list_experience"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="#+id/bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="bottom"
>
<LinearLayout
android:id="#+id/linear_call"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:orientation="vertical"
android:gravity="center"
android:padding="8dp"
android:background="#drawable/list_selector">
<ImageView
android:id="#+id/btn_phone_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/call_us_tab"/>
<TextView
android:id="#+id/call"
android:textColor="#android:color/white"
android:text="Call Us"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#5488B8" />
<LinearLayout
android:id="#+id/linear_message"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:orientation="vertical"
android:gravity="center"
android:padding="8dp"
android:background="#drawable/list_selector"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/message_tab"
/>
<TextView
android:id="#+id/msg"
android:textColor="#android:color/white"
android:text="Message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#5488B8" />
<LinearLayout
android:id="#+id/linear_share"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:orientation="vertical"
android:gravity="center"
android:background="#drawable/list_selector"
android:padding="8dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/share_tab"/>
<TextView
android:id="#+id/share"
android:textColor="#android:color/white"
android:text="Share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
You need to use RelativeLayout instead of LinearLayout at parent and then you can place items up and down to each other like
which view you want below to another view you can use this
android:layout_below="#+id/yourview"
and for view you want above to other you can use this
android:layout_above="#+id/yourview"
here is a sample
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/main"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView">
<!-- some stuff in here -->
</LinearLayout>
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
Hope it helps
try this hopefully this is what you wanted
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="#+id/my_recycler_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fadingEdgeLength="0dp"
android:overScrollMode="never"
android:scrollbars="horizontal"
/>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="220dp"
android:fadingEdgeLength="0dp"
android:padding="5dp"
android:fillViewport="true"
android:overScrollMode="never"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/tv_name_detail_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textStyle="bold"
android:layout_marginTop="5dp"
android:text="Name"/>
<TextView
android:id="#+id/tv_address"
android:text="address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<RatingBar
android:layout_marginTop="2dp"
android:id="#+id/rating_bar_pro_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
/>
<TextView
android:id="#+id/tv_nearby"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
/>
<TextView
android:layout_marginTop="5dp"
android:id="#+id/tv_specialization"
android:text="Specialization: "
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<ListView
android:layout_marginTop="5dp"
android:id="#+id/list_specialization"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textStyle="bold"
android:layout_marginTop="5dp"
android:id="#+id/tv_education"
android:text="Education:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ListView
android:layout_marginTop="5dp"
android:id="#+id/list_education"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textStyle="bold"
android:id="#+id/tv_experiences"
android:layout_marginTop="5dp"
android:text="Experiences:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ListView
android:layout_marginTop="5dp"
android:id="#+id/list_experience"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="5"
>
<LinearLayout
android:layout_weight="2"
android:id="#+id/bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="bottom"
android:weightSum="3"
>
<LinearLayout
android:id="#+id/linear_call"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center"
android:weightSum="3"
android:background="#000000">
<ImageView
android:id="#+id/btn_phone_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/name_top"
android:layout_weight="2"
/>
<TextView
android:id="#+id/call"
android:textColor="#android:color/white"
android:text="Call Us"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#5488B8" />
<LinearLayout
android:id="#+id/linear_message"
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:weightSum="2"
android:layout_weight="1"
android:background="#000000"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/name_top"
android:layout_weight="1"
/>
<TextView
android:id="#+id/msg"
android:textColor="#android:color/white"
android:text="Message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#5488B8" />
<LinearLayout
android:id="#+id/linear_share"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center"
android:background="#000000"
android:weightSum="2"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/name_top"
android:layout_weight="1"
/>
<TextView
android:id="#+id/share"
android:textColor="#android:color/white"
android:text="Share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</LinearLayout>
</LinearLayout>
<!-- The navigation drawer -->
<ListView
android:layout_weight="3"
android:id="#+id/left_drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="#5488B8"
android:dividerHeight="1dp"
android:background="#00427F"
android:listSelector="#898989"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Please update version of a recyclerview library in gradle file :
compile 'com.android.support:recyclerview-v7:23.2.1'
It should solve your issue.
Due to this issue, wrap_content not used to work on recyclerview before this version.