How can i create this Layout in android studio? I try to write some codes but i can' t complete that. Thank you for helps. Should i use LinearLayout or RelativeLayout or TableLayout for same viewing for all devices.
http://i.imgur.com/EBd3CAo.png
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1"
android:background="#404040">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="59dp"
android:orientation="horizontal"
android:weightSum="1">
<EditText
android:layout_width="198dp"
android:id="#+id/editText"
android:layout_above="#+id/tv1"
android:layout_marginBottom="31dp"
android:text="12345678901"
android:autoText="false"
android:elegantTextHeight="false"
android:maxLength="11"
android:singleLine="true"
android:background="#000000"
android:textColor="#a0a0a0"
android:inputType="number"
android:textSize="40dp"
android:textAlignment="center"
android:textStyle="bold"
android:layout_height="50dp"
android:layout_weight="0.45" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="tv1"
android:id="#+id/tv1"
android:layout_weight="0.36"
android:textColor="#55ff1c"
android:paddingLeft="10dp" />
</LinearLayout>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="bla bla bla bla bla"
android:id="#+id/cbx1"
android:checked="false"
android:singleLine="true"
android:textSize="18dp" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ListView
android:layout_width="180dp"
android:layout_height="wrap_content"
android:id="#+id/listView" />
<LinearLayout
android:orientation="vertical"
android:layout_width="180dp"
android:layout_height="wrap_content">
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"></RadioGroup>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Change margin/padding/fontsize/color as required
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#404040"
android:orientation="vertical"
android:weightSum="3">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<EditText
android:id="#+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_above="#+id/tv1"
android:autoText="false"
android:background="#000000"
android:elegantTextHeight="false"
android:inputType="number"
android:maxLength="11"
android:singleLine="true"
android:text="12345678901"
android:textAlignment="center"
android:textColor="#a0a0a0"
android:textSize="40dp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="tv1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#55ff1c" />
</LinearLayout>
<CheckBox
android:id="#+id/cbx1"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:singleLine="true"
android:text="bla bla bla bla bla"
android:textSize="18dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="2.8"
android:layout_margin="10dp"
android:layout_height="0dp"
android:orientation="horizontal">
<ListView
android:id="#+id/listView"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="vertical">
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
<RadioButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="RadioButton1"/>
<RadioButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="RadioButton2"/>
</RadioGroup>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="20sp"
android:text="Text View" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="20sp"
android:text="Text View" />
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:padding="5dp"
android:text="button" />
</LinearLayout>
</LinearLayout>
<TextView
android:layout_gravity="bottom"
android:layout_width="match_parent"
android:layout_weight="0.2"
android:layout_margin="10dp"
android:layout_height="wrap_content"
android:text="Bottomtextview"/>
</LinearLayout>
I made a design as you need. But you may need to set height and width by your own. take a look to the below code.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:hint="Edit Text" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Text View" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Check Box" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<ListView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Radio Button" />
<RadioButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Radio Button" />
</RadioGroup>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Text View"
android:textSize="24sp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_weight="1"
android:text="Text View" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="10dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:textSize="24sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Text View"
android:textSize="30sp" />
</LinearLayout>
</LinearLayout>
I designed this by linear layout. hope it helps you.
Related
I have been using this code inside Co-ordinatorLayout, with no issues. I tried tweaking the code to work inside ConstraintLayout. While displaying Snackbar, the Snackbar is overlapping FAB. Also, I am unable to auto hide Toolbar. Can someone guide on how to auto-hide Toolbar and FAB inside ConstraintLayout.
<android.support.constraint.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:id="#+id/acbl_layout_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.sample.android.ActivitySample">
<!--Toolbar-->
<android.support.design.widget.AppBarLayout
android:id="#+id/acbl_layout_toolbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<include layout="#layout/toolbar" />
</android.support.design.widget.AppBarLayout>
<!--Layout-->
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<!--FAB-->
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="#dimen/dp_16"
app:fabSize="normal"
app:layout_anchor="parent"
app:layout_anchorGravity="bottom|end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="#drawable/icon_add" />
</android.support.constraint.ConstraintLayout>
It is easy to do in a constraint layout, all you have to do is hook up both vertical constraints of the fab to the end of the top image, this will center it on the line:
With CoordinatorLayout you can interact with different child views, like Snackbar and FAB can interact to move accordingly.
You can't achieve that with ConstraintLayout
Further Details: CoordinatorLayout | Android Developers
Try with Co-ordinator layout instead it is similar to constraint and easy to handle
And you can wrap your elements into coordinator layout which will solve your problem and will also provide additional functionality to the code.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="match_parent"
android:layout_width="match_parent">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fillViewport="true"
>
<!--android:background="#drawable/libertybro340x240"-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#fff"
>
<!--android:background="#color/transparent_background"-->
<include
layout="#layout/actvity_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingLeft="4dp"
android:paddingRight="3dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
>
<TextView
style="#style/small_title_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/case_number"
android:singleLine="true"
android:layout_weight="1.3"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=":"/>
<TextView
style="#style/small_title_text"
android:id="#+id/display_casenum_Txt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/case_number"
android:text="26/11"
android:singleLine="true"
android:layout_weight="1"
/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/colorPrimaryDark"
android:layout_marginTop="5dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/clientVoppo"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
>
<TextView
style="#style/small_title_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/client_name"
android:singleLine="true"
android:layout_weight="1.3"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=":"/>
<TextView
style="#style/small_title_text"
android:id="#+id/display_client_Txt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/client_name"
android:text="Kaware Patil"
android:layout_weight="1"
/>
</LinearLayout>
<TextView
style="#style/small_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="VS"
android:layout_gravity="center_horizontal"
android:singleLine="true"
android:editable="false"
android:textStyle="bold"
android:textColor="#color/colorPrimaryDark"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
>
<TextView
style="#style/small_title_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Opposition"
android:singleLine="true"
android:layout_weight="1.3"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=":"/>
<TextView
style="#style/small_title_text"
android:id="#+id/display_opposition_Txt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/opposition_name"
android:text="Mumbai High Court"
android:layout_weight="1"
/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/colorPrimaryDark"
android:layout_marginTop="5dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
>
<TextView
style="#style/small_title_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/ipc_act"
android:singleLine="true"
android:layout_weight="1.3"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=":"/>
<TextView
style="#style/small_title_text"
android:id="#+id/display_ipc_Txt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/ipc_act"
android:text="420"
android:layout_weight="1"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
>
<TextView
style="#style/small_title_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/advocate_name"
android:singleLine="true"
android:layout_weight="1.3"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=":"/>
<TextView
style="#style/small_title_text"
android:id="#+id/display_advocate_Txt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/advocate_name"
android:text="Prasad Gunjal"
android:singleLine="true"
android:layout_weight="1"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
>
<TextView
style="#style/small_title_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/on_behalf"
android:singleLine="true"
android:layout_weight="1.3"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=":"/>
<TextView
style="#style/small_title_text"
android:id="#+id/display_onBehalf_Txt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/on_behalf"
android:text="Complainant"
android:singleLine="true"
android:layout_weight="1"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
>
<TextView
style="#style/small_title_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/casecourt_name"
android:singleLine="true"
android:layout_weight="1.3"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=":"/>
<TextView
style="#style/small_title_text"
android:id="#+id/display_court_Txt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/casecourt_name"
android:text="Bombay high Court"
android:layout_weight="1"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
>
<TextView
style="#style/small_title_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/case_status"
android:singleLine="true"
android:layout_weight="1.3"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=":"/>
<TextView
style="#style/small_title_text"
android:id="#+id/display_casestat_Txt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/case_status"
android:text="On Hold"
android:singleLine="true"
android:layout_weight="1"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
>
<TextView
style="#style/small_title_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/case_filing_date"
android:singleLine="true"
android:layout_weight="1.3"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=":"/>
<TextView
style="#style/small_title_text"
android:id="#+id/display_casefiling_Txt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/case_filing_date"
android:text="26/11/2011"
android:singleLine="true"
android:layout_weight="1"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
>
<TextView
style="#style/small_title_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/number_of_people"
android:singleLine="true"
android:layout_weight="1.3"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=":"/>
<TextView
style="#style/small_title_text"
android:id="#+id/display_peoplenumer_Txt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/number_of_people"
android:text="2"
android:singleLine="true"
android:layout_weight="1"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
>
<TextView
style="#style/small_title_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Next Hearing"
android:singleLine="true"
android:layout_weight="1.3"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=":"/>
<TextView
style="#style/small_title_text"
android:id="#+id/display_nextdateNtime_Txt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/next_hearing_date"
android:text="11/11/11 10:00 AM"
android:singleLine="true"
android:layout_weight="1"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
>
<TextView
style="#style/small_title_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/next_hearing_details"
android:singleLine="true"
android:layout_weight="1.3"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=":"
/>
<TextView
style="#style/small_title_text"
android:id="#+id/display_nextdetails_Txt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/next_hearing_details"
android:text="Jury on bench"
android:layout_weight="1"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab_caseinfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_gravity="end|bottom"
android:layout_marginRight="#dimen/fab_margin"
android:layout_marginBottom="#dimen/fab_margin"
android:padding="5dp"
android:src="#android:drawable/ic_menu_edit" />
</android.support.design.widget.CoordinatorLayout>
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"/>
I have two problem in ScrollView when I try to put in my xml layout code.
First problem: I can see just first item inside ListView and overviewMovie TextView text is hidden, second problem: is ScrollView just work in orientation landscape.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:padding="16dp">
<LinearLayout xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="**.DetialFragment">
<TextView
android:id="#+id/titleDetialMovie"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/CadetBlue"
android:gravity="left"
android:padding="30dp"
android:textColor="#color/white"
android:textSize="40dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:orientation="horizontal">
<ImageView
android:id="#+id/postImageMovie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:scaleType="center"
android:src="#drawable/abc_btn_rating_star_on_mtrl_alpha" />
<TextView
android:id="#+id/dateReleaseMovie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="16dp"
android:paddingLeft="18dp"
android:textSize="16dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:padding="16dp">
<RatingBar
android:id="#+id/ratingMovie"
style="#style/foodRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:isIndicator="true"
android:numStars="9"
android:stepSize="0.1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="10dp"
android:text="Summary"
android:textSize="18dp"
android:textStyle="bold" />
<TextView
android:id="#+id/overviewMovie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:textSize="18dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="10dp"
android:text="Review"
android:textSize="18dp"
android:textStyle="bold" />
<FrameLayout
android:id="#+id/fragment_detial"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
tools:context="**.DetialFragment">
<ListView
android:id="#+id/list_review"
android:layout_width="fill_parent"
android:layout_height="wrap_content"></ListView>
</FrameLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="10dp"
android:text="List Video"
android:textSize="18dp"
android:textStyle="bold" />
<FrameLayout
android:id="#+id/fragment_video"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
tools:context="**.DetialFragment">
<ListView
android:id="#+id/list_video"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
></ListView>
</FrameLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="**.DetialFragment">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:padding="16dp">
<TextView
android:id="#+id/titleDetialMovie"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/CadetBlue"
android:gravity="left"
android:padding="30dp"
android:textColor="#color/white"
android:textSize="40dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:orientation="horizontal">
<ImageView
android:id="#+id/postImageMovie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:scaleType="center"
android:src="#drawable/abc_btn_rating_star_on_mtrl_alpha" />
<TextView
android:id="#+id/dateReleaseMovie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="16dp"
android:paddingLeft="18dp"
android:textSize="16dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:padding="16dp">
<RatingBar
android:id="#+id/ratingMovie"
style="#style/foodRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:isIndicator="true"
android:numStars="9"
android:stepSize="0.1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="10dp"
android:text="Summary"
android:textSize="18dp"
android:textStyle="bold" />
<TextView
android:id="#+id/overviewMovie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:textSize="18dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="10dp"
android:text="Review"
android:textSize="18dp"
android:textStyle="bold" />
<FrameLayout
android:id="#+id/fragment_detial"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
tools:context="**.DetialFragment">
<ListView
android:id="#+id/list_review"
android:layout_width="wrap_content"
android:scrollbars="vertical"
android:layout_height="wrap_content"></ListView>
</FrameLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="10dp"
android:text="List Video"
android:textSize="18dp"
android:textStyle="bold" />
<FrameLayout
android:id="#+id/fragment_video"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
tools:context="**.DetialFragment">
<ListView
android:id="#+id/list_video"
android:layout_width="wrap_content"
android:scrollbars="vertical"
android:layout_height="wrap_content"
></ListView>
</FrameLayout>
</LinearLayout>
I want to create following layout.
--------------------------------
Title
Summary Info
[Get Direction][Call][More Info]
--------------------------------
I code following layout but buttons not showing. I have no idea why LinearLayout works like FrameLayout so the RelativeLayout hides buttons. Did I miss something here?
I am using support library 22.1
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="#dimen/location_card_height">
<ImageView android:id="#+id/cardImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="center"
android:layout_gravity="center" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom" >
<TextView android:id="#+id/title"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="?android:attr/textAppearanceLargeInverse"
android:singleLine="true"
android:hint="Title" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#id/title">
<TextView android:id="#+id/info"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="?android:attr/textAppearance"
android:singleLine="true"
android:hint="Info"
android:layout_alignParentRight="true"
android:ellipsize="end" />
<TextView android:id="#+id/summary"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textAppearance="?android:attr/textAppearance"
android:singleLine="true"
android:hint="Summary"
android:layout_toLeftOf="#id/info"
android:ellipsize="end" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/panelAction"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="#+id/btnDirection"
android:text="#string/get_direction"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="#+id/btnCall"
android:text="#string/label_call"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="#+id/btnMoreInfo"
android:text="#string/more_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
Your relative layout has been set to match_parent for it height!
change it to wrap_content
that should help you
or put it in a LinearLayout
something like this :
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="#dimen/location_card_height">
<ImageView android:id="#+id/cardImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="center"
android:layout_gravity="center" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5"
android:orientation="vertical" >
<RelativeLayout
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom" >
<TextView android:id="#+id/title"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="?android:attr/textAppearanceLargeInverse"
android:singleLine="true"
android:hint="Title" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#id/title">
<TextView android:id="#+id/info"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="?android:attr/textAppearance"
android:singleLine="true"
android:hint="Info"
android:layout_alignParentRight="true"
android:ellipsize="end" />
<TextView android:id="#+id/summary"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textAppearance="?android:attr/textAppearance"
android:singleLine="true"
android:hint="Summary"
android:layout_toLeftOf="#id/info"
android:ellipsize="end" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/panelAction"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
>
<Button
android:id="#+id/btnDirection"
android:text="#string/get_direction"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="#+id/btnCall"
android:text="#string/label_call"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="#+id/btnMoreInfo"
android:text="#string/more_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
If you are fine With Linearlayout Then Here is Your XML file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1" >
<ImageView
android:id="#+id/cardImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:scaleType="center"
android:src="#drawable/ic_launcher" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="#+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Title"
android:singleLine="true"
android:text="Title"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/summary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_toLeftOf="#id/info"
android:layout_weight="1"
android:ellipsize="end"
android:hint="Summary"
android:singleLine="true"
android:text="Summary"
android:textAppearance="?android:attr/textAppearance" />
<TextView
android:id="#+id/info"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="right"
android:hint="Info"
android:singleLine="true"
android:text="Info"
android:textAppearance="?android:attr/textAppearance" />
</TableRow>
</LinearLayout>
<LinearLayout
android:id="#+id/panelAction"
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="bottom" >
<Button
android:id="#+id/btnDirection"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Get_direction" />
<Button
android:id="#+id/btnCall"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="call" />
<Button
android:id="#+id/btnMoreInfo"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="more_info" />
</LinearLayout>
I am having a screen which has many layouts having title,list view ,comment and buttons but buttons are not getting displayed at all,after list view display I am getting a huge amount of empty space after which comment is getting displayed and buttons are not seen ,this is my code.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#android:color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:layout_margin="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="12345617890" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:fontFamily="#android:color/black"
android:text="Ramakrisha Tripati" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="9876543210" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_margin="10dp"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="13/1/2015" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="Rohit Sharma" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="55dp"
android:orientation="horizontal"
android:background="#android:color/holo_orange_light">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="item#\nstyle#"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="M Wt\nD Wt\nCS Wt"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Making\nD Rate\nCS Rate"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Margin\nDis %\nDiscount"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GT\nFSP"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView android:id="#+id/listView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:divider="#00000000"
android:dividerHeight="5dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dp"
android:text="Comment" />
<EditText
android:id="#+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:ems="10"
android:hint="Comment goes here"
android:inputType="textMultiLine" />
</LinearLayout>
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="accept"
android:src="#drawable/accept"
/>
</LinearLayout>
I have modified your layout code and now the button has appeared.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/white"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="12345617890" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:fontFamily="#android:color/black"
android:text="Ramakrisha Tripati" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="9876543210" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="13/1/2015" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="Rohit Sharma" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="55dp"
android:background="#android:color/holo_orange_light"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="item#\nstyle#" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="M Wt\nD Wt\nCS Wt" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Making\nD Rate\nCS Rate" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Margin\nDis %\nDiscount" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="GT\nFSP" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="#+id/listView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:divider="#00000000"
android:dividerHeight="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Comment"
android:textSize="25dp" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<EditText
android:id="#+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:ems="10"
android:hint="Comment goes here"
android:inputType="textMultiLine" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:onClick="accept"
android:src="#drawable/accept" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Just put your main LinearLayout inside scrollview and you will see thr buttons.
And if not so maybe your image is so small or transparent.
check with another image maybe.