ListView with other elements
I want to show a ListView with two Buttons belows (outside of list) it. But as my Activity extends ListActivity, I am facing problems on setContentView. Can anybody please help me?
Updates: Solution
I got the solution. No matter which and how many elements we use on a ListActivity, the id (android:id) of ListView in XML file must be @android:id/list. :开发者_Python百科-)
Set the id (android:id
) of ListView in XML file to @android:id/list
.
Can you post your layout XML?
Basically if you're using Linear Layouts the hierarchy will be as such
LinearLayout (orientation:vertical)
|---ListView (layout-weight:1)
|---LinearLayout (used for buttons)
|-- Button 1
|-- Button 2
If you show me you XML I can show you what you need to do..Unless the above snippet helps you fix it of course ;-)
精彩评论