How do i fix an edittext and a send button at bottom of my List View?
I have a list view in which i m getting my data from server. but at the bottom i need an edit text and a send button so that its like a chat app. where i can type my message and send it back to server and it adds to my list view at the same tym.
Plz give me some开发者_StackOverflow中文版 suggestions. Thanks in advance.
Make height and width of your ListView fill_parent and give it weight 1 and then below your list view add a horizontal linear layout consisting of your edit text and button
define a xml containing a edittext and a button and set it in the list as a footer like this:
View footerView = ((LayoutInflater)getApplicationContext().getSystemService(getApplicationContext().LAYOUT_INFLATER_SERVICE)).inflate(R.layout.your_footer, null, false);
list.addFooterView(footerView,null,false);
精彩评论