I am creating some views in my xml file, xml file contaings list-view.
In that list-view I have list selector attribute and i defined drawable
image for selector.
My xml file follows like this:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="#+id/frameLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.naaima.vovinet.activity.VideoNativePlayer
android:layout_marginLeft="50dip"
android:layout_width="800dip"
android:layout_marginRight="30dip"
android:id="#+id/video_view"
android:layout_height="600dip"
android:layout_marginTop="50dip">
</com.naaima.vovinet.activity.VideoNativePlayer>
<ImageView android:src="#drawable/icon"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/imageView1"/>
<ImageView android:src="#drawable/icon"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
android:id="#+id/imageView2"/>
<LinearLayout android:id="#+id/linearlayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="#+id/textView_channelno"
android:layout_width="130dip"
android:hint="_ _ _"
android:layout_marginLeft="1050dip"
android:layout_marginTop="20dip"
android:background="#drawable/sample"
android:gravity="center"
android:textSize="25dip"
android:visibility="gone"
android:layout_height="80dip"/>
</LinearLayout>
<FrameLayout android:id="#+id/frameLayout2"
android:layout_width="1100dip"
android:layout_height="wrap_content"
android:background="#drawable/bg1"
android:layout_gravity="bottom"
android:layout_marginLeft="100dip"
android:layout_marginBottom="15dip">
<RelativeLayout android:id="#+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ProgressBar style="?android:attr/progressBarStyleHorizontal"
android:layout_width="730dip"
android:layout_height="wrap_content"
android:id="#+id/progressBar"
android:layout_marginTop="30dip"
android:background="#drawable/progress_bar_bg"
android:layout_marginLeft="180dip"/>
<TextView android:id="#+id/textView_date"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_toRightOf="#+id/progressBar"
android:layout_marginTop="30dip"
android:layout_marginLeft="50dip"/>
<TextView android:id="#+id/textView_time"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="#+id/textView_date"
android:layout_marginTop="3dip"
android:layout_toRightOf="#+id/list"
android:layout_marginLeft="57dip"
/>
<TextView
android:id="#+id/textView_location"
android:text="Hyderabad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView_time"
android:layout_marginTop="10dip"
android:layout_marginRight="10dip"
android:layout_toRightOf="#+id/imageView_temp"
/>
<TextView
android:id="#+id/textView_temp"
android:text="35 Degrees"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView_location"
android:layout_marginRight="10dip"
android:layout_marginTop="5dip"
android:layout_toRightOf="#+id/imageView_temp"
/>
<ImageView android:id="#+id/imageView_temp"
android:src="#drawable/temp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView_time"
android:layout_toRightOf="#+id/list"
android:layout_marginLeft="20dip"/>
<ImageView android:id="#+id/imageView_logo"
android:src="#drawable/zee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dip"
android:layout_marginLeft="50dip"/>
<ImageView android:id="#+id/imageView_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/arrow_left_gray"
android:layout_marginTop="110dip"
android:layout_marginLeft="23dip"/>
<TextView android:id="#+id/txt_channelName"
android:text="M-Tunes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="110dip"
android:layout_marginLeft="50dip"/>
<ImageView android:id="#+id/imageView_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/arrow_right_gray"
android:layout_marginTop="110dip"
android:layout_marginLeft="150dip"/>
<ListView android:id="#+id/list"
android:layout_width="690dip"
android:layout_height="125dip"
android:layout_below="#+id/progressBar"
android:layout_marginLeft="220dip"
android:listSelector="#drawable/highlight_bar"/>
<ImageView android:id="#+id/imageView_up"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/arrow_up_gray"
android:layout_below="#+id/progressBar"
android:layout_marginTop="5dip"
android:layout_marginLeft="180dip"/>
</RelativeLayout>
</FrameLayout>
</FrameLayout>`
Row.xml
<?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"
>
<TextView android:text="TextView"
android:id="#+id/textView_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
And java code is like following
ListView lv = (ListView) findViewById(R.id.list);
String[] values = new String[] { "Now:Harry Potter and Deathly Hellows", "Lord of the Rings:Two Towers", "Lord of the Rings:Return of King",
"rd of the Rings:Honneypot solo Dance"};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
R.layout.row,R.id.textView_list, values);
lv.setAdapter(adapter);
lv.setSelector(R.drawable.highlight_bar);
lv.setDivider(null);
If I am executing only listview with row xml code list selector working fine.
If I am pressing up and down arrows it's working fine. But I am integrating
listview with above code it's not working and if I am pressing up and arrows
in keyboard no use (focusing not going to listview side).
Just to add on to Jason's above response. I recently ran into this issue and Jason's answer was spot on, except I needed to call requestFocusFromTouch() on my listView to make it work in response to touch obviously. requestFocus() was not helpful in my scenario but requestFocusFromTouch() was. Hopefully that helps someone out there.
Have you tried calling "requestFocus()" on the listView in your code after setting android:focusable="true" in the xml? From the View docs:
"Call this to try to give focus to a specific view or to one of its descendants. A view will not actually take focus if it is not focusable (isFocusable() returns false), or if it is focusable and it is not focusable in touch mode (isFocusableInTouchMode()) while the device is in touch mode. See also focusSearch(int), which is what you call to say that you have focus, and you want your parent to look for the next one. This is equivalent to calling requestFocus(int, Rect) with arguments FOCUS_DOWN and null."
Related
I have used GridView in my project and with that I included the ViewHolder.
Now, the customer wants to show the data using an ExpandableListView for the fact that he wants to only show the header and when the user clicks on the header, it shows the child below it.
Having no prior experience, I want to know if it possible to change from GridView to ExpandableListView easily in the code.
Note that I have also included text search on the Grid. Will that still be available if I switch to ExpandableListView?
If the above is possible, can anyone help how I could achieve it.
The Grid row xml is as follows
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="8dip"
android:paddingRight="4dip">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="0.8">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:typeface="sans"
android:textSize="13sp"
android:textStyle="bold"
android:id="#+id/placeName"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#88FFFFFF"
android:typeface="sans"
android:textSize="13sp"
android:textStyle="bold"
android:id="#+id/theme"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:id="#+id/Title"/>
<TextView
android:id="#+id/Details"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dip"
/>
<TextView
android:id="#+id/scheduleDays"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:layout_gravity="bottom"
android:layout_marginRight="5dip"
android:layout_marginTop="7dip"
android:text="Family, Friends, Relatives, Grand-Parents"
android:textStyle="bold"/>
<TextView
android:id="#+id/Date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:layout_gravity="right"
android:layout_marginRight="5dip"
/>
</LinearLayout>
<LinearLayout
android:id="#+id/rightLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:orientation="vertical"
android:minWidth="60dp"
android:layout_weight="0.2">
<ImageView
android:id="#+id/starButton"
android:layout_width="40dp"
android:layout_gravity="right"
android:layout_marginRight="5dip"
android:layout_height="40dp"
android:background="#00FFFFFF"
android:src="#drawable/Favourite"/>
<ImageView
android:id="#+id/showMeButton"
android:layout_width="40dp"
android:layout_gravity="right"
android:layout_marginRight="15dip"
android:src="#drawable/showMe"/>
</LinearLayout>
</LinearLayout>
<View
android:id="#+id/separator"
android:layout_marginTop="5dip"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#33000000" />
</LinearLayout>
With ListView, I want to show PlaceName, Favourite Button and ShowMe Button as the headers and the rest as the child.
You can integrate the Expandable ListView in an Layout, like LinearLayout.
For this Change the Layout type in the layout.xml of your activity
To send the Data to the ListView you need to use an BaseExpandableListAdapter that pulls the Content out of an Array or a Database.
Example for the layout.xml
<LinearLayout .... >
<ExpandableListView
.... >
</ExpandableListView>
</LinearLayout>
can you show your xml file. well can be achieve is many ways.
like change your layout container from grid layout to linear layout
as in your adapter
and set your View in onCreate
recycler.setHasFixedSize(true);
final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
recycler.setLayoutManager(layoutManager);
adapter = new Adapter(getActivity());
recycler.setAdapter(adapter);
Here is my XML layout. I have a list view inside my scrollview. I am setting the height manually if I change the listview height to wrap_content it is not working. And also if the data grows beyond the limit it is hiding. I am seeing many answers to solve this. What is the best option to solve it for my case?
<?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" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:focusableInTouchMode="true" >
<LinearLayout
android:id="#+id/store_scroller"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="#c6c6c6"
android:padding="10dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout_alignParentLeft="true"
android:text="Stores"
android:textSize="20dp" />
<TextView
android:id="#+id/merchant_count_textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="0 Results" />
</RelativeLayout>
<Gallery
android:id="#+id/gallery1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:gravity="left"
android:listSelector="#color/gridviewlistselector"
android:paddingLeft="10dp"
android:paddingRight="20dp"
android:paddingTop="10dp"
android:spacing="10dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="55dp"
android:background="#c6c6c6"
android:padding="10dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout_alignParentLeft="true"
android:text="Products"
android:textSize="20dp" />
<Spinner
android:id="#+id/filter_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_toRightOf="#+id/textView1" />
<TextView
android:id="#+id/product_count_textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="0 Results" />
</RelativeLayout>
<ListView
android:id="#+id/list"
android:layout_width="fill_parent"
android:layout_height="4800dp"
android:layout_weight="1"
android:drawSelectorOnTop="true"
android:listSelector="#color/gridviewlistselector"
android:orientation="vertical" />
</LinearLayout>
</LinearLayout>
</ScrollView>
Short answer: You can't (shouldn't) have a ListView wrapped in a ScrollView.
Long answer: As Romain Guy (UI-guru at Google themselves) once said:
Using a ListView to make it not scroll is extremely expensive and goes against the whole purpose of ListView. You should NOT do this. Just use a LinearLayout instead.
Quote via "How can I put a ListView into a ScrollView without it collapsing?".
Instead using List View in ScrollView you can make separate layout where you can define your desired components. then you can make that layout haeder of the ListView. You can use following code:
LayoutInflater inflater = LayoutInflater.from(this);
View LTop = inflater.inflate(R.layout.header_tolistview, null);
listview.addHeaderView(LTop);
I have a listview with some text and a checkbox. I can click the checkbox, and the check changes, but when I try to listen for the check being changed, or the click, the listener never triggers.
I have the listview in an Activity (not a ListActivity)
schedule.xml layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:id="#+id/schedulerLayout">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:paddingBottom="10dp">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/currentHours"
android:textSize="50dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="50dp"
android:text=":"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/currentMinutes"
android:textSize="50dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="vertical">
<!--vertical filler for am/pm display -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/ampm"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/currentDayOfWeek"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/currentDate"/>
</LinearLayout>
</LinearLayout>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/scheduleButton"
android:text="#string/newSchedule"/>
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="#FFFFFFFF"/>
<ListView
android:id="#+id/scheduler_list_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"/>
</LinearLayout>
schedulerow.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true">
<TextView
android:id="#+id/scheduleListTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:text="Title"/>
<TextView
android:id="#+id/scheduleListDays"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/scheduleListTitle"
android:text="Days"/>
<TextView
android:id="#+id/scheduleListMonths"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/scheduleListDays"
android:text="Months"/>
<View
android:id="#+id/schedulerSeparator"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="#FFFFFFFF"
android:layout_below="#id/scheduleListMonths"/>
<CheckBox
android:id="#+id/scheduleCheckBox"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="true"
android:layout_above="#id/schedulerSeparator"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
<TextView
android:id="#+id/scheduleListTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="#id/scheduleCheckBox"
android:text="Time"/>
</RelativeLayout>
I'm filling in the data like this:
SimpleAdapter adapter = new SimpleAdapter(this,
data,
R.layout.schedulerow,
new String[] {"Title","Time","Day", "Month"},
new int[] { R.id.scheduleListTitle, R.id.scheduleListTime,R.id.scheduleListDays, R.id.scheduleListMonths});
listView.setAdapter(adapter);
If I try to add a listener to the checkbox, it does nothing. Any suggestions? I've looked through a TON of sample code and similar questions, and none of it seems to work.
One solution is to forget the list item click listener and use another listener for the rest of the item other than the checkbox.. In item layout xml, put the other views in single layout and set the click listener on this and set the check listener on checkbox as usual. Both will work without issues. Dont use the list item click listener.
class MySimpleAdapter extends SimpleAdapter {
...
#Override
void getView(.....) {
View view = super.getView(.....);
view.findViewById(R.id.checkboxid).setOnCheckChangedListner(checklistener);
view.findViewById(R.id.restOfitemview).setOnClickListner(clickListner);
return view;
}
}
Define the two listeners and set as shown above.
Edit : First try your method(blocking focus on checkbox) with the MySimpleAdapter setting only the checkchangelistener.. If that does not work then use above solution of dividing the item layout.
My problem is to find best view configuration for my application that have a record in the listView.
My main.xml has this content:
<LinearLayout android:id="#+id/tabName" android:orientation="vertical"
android:layout_width="match_parent" android:layout_height="match_parent">
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/textConnection" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:minHeight="20dp"
/>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/textTitle" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:minHeight="40dp"
/>
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/listRecord"
android:layout_width="match_parent" android:layout_height="match_parent">
</ListView>
</LinearLayout>
And the my actual row of ListView is:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/imageBox"
android:layout_width="48px"
android:layout_marginTop="13dp"
android:layout_height="48px">
</ImageView>
<TextView
android:id="#+id/longText" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
/>
<TextView
android:id="#+id/num1" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
/>
<TextView
android:id="#+id/num2" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
/>
<TextView
android:id="#+id/num3" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
/>
</LinearLayout>
I tried with TableLayout but starting the application report an error in the bindView.
Can I write my XML code with only textView?
Consider that then I must add the caption of the ListView that have three image above each column with number.
Thank's.
I think the ListView is indeed your best option.
Can I write my XML code with only textView?
Yes, of course.
I don't see what is your problem actually. You should have an activity layout with the textConnection, the textTitle, then the 3 images aligned to the right (missing in your layout file), and the listview.
As for the row xml layout, I think it is OK! Just combine it with a simple cursor adapter in your java code, and you're done.
had make layout for showing the content in listview and a button below on list view for displaying more information on list view ,so first i am showing only 4 rows in list view and when i next time click on button 4 rows again added in list so now my button goes down in screen so how to make whole layout scroll able so that i can go to button via scrolling my layout is..
listplacehold.xml is
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#1A77BD"
>
<ListView
android:id="#+id/android:list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawSelectorOnTop="false" />
<View
android:id="#+id/horizontolline"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:layout_below="#id/android:list"
android:background="#000000"
/>
<Button
android:text="Load More..."
android:textColor="#color/white"
android:id="#+id/keywordsearchbutton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#id/horizontolline"
android:drawableLeft="#drawable/load_more_off"
android:gravity="left|center_vertical"
android:background="#1A77BD"
/>
</RelativeLayout>
and for list item layout is: listitem.xml is
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView android:id="#+id/img"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
/>
<!-- Location where barrio items will be displayed -->
<TextView
android:id="#+id/reportid"
android:layout_marginLeft="70dip"
android:text="reporet id"
android:textColor="#color/white"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
/>
<TextView android:id="#+id/status"
android:textColor="#color/white"
android:text="status"
android:layout_marginTop="40dip"
android:layout_marginLeft="200dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView android:id="#+id/title"
android:text="title"
android:layout_marginLeft="150dip"
android:textColor="#color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/date"
android:text="dateeeeeee"
android:layout_marginLeft="70dip"
android:layout_marginTop="40dip"
android:textColor="#color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
items are dynamically loadein list view when button click
i think that scroll will be set on above xml means on "listplacehold.xml" but how?,when i am doing it is set to for half screen,means it is not displaying in whole view... Thanks for help in advance.
don't use the ScrollView with the combination of the ListView. Instead make your layout like this.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#1A77BD" >
<Button
android:id="#+id/lodmore"
android:text="Load More..."
android:textColor="#color/white"
android:id="#+id/keywordsearchbutton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true""
android:drawableLeft="#drawable/load_more_off"
android:gravity="left|center_vertical"
android:background="#1A77BD"/>
<View
android:id="#+id/horizontolline"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:layout_above="#id/loadmore"
android:background="#000000"/>
<ListView
android:id="#+id/android:list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_alignParentTop="true"
android:layout_above="#id/horizontolline/>
</RelativeLayout>
put scrollview over your root layout and remember only one layout node is allowed under scrollview.....
refer this doc:
http://developer.android.com/reference/android/widget/ScrollView.html