Monday 15 June 2015

android - List View above Linear Layout -


I'm trying to keep a linear layout below a list view in XML and I get this error for some reason

android.widget.ImageButton can not be placed on Android.widget.ListView

at com.yonivy ... .konet ... .Java: 37

here is xml

   & Lt; Android: layout_weight = "1" Android: background = "@ android: color / transparent" Android: id = "@ + id / editBtn" android: layout_width = "0dip" Android: layout_height = "wrap_content" Android: src = " @drawable / content_edit "/> & Lt; ImageButton android: id = "@ + id / deleteBtn" Android: layout_width = "0dip" Android: Layout_height = "Wrap_content" Android: layout_weight = "1" android: background = "@ android: color / transparent" android: src = " @drawable / navigation canal "/> & Lt; / LinearLayout & gt;   

And here onCreate

  @Override public void OnCreate (Bundle savedInstanceState) {super.onCreate (savedInstanceState); SetContentView (R.layout.category_activities); Lv = (ListView) findViewById (R.id.mList); // line 37 // ...}   

If I keep the list view as the last child, everything works fine for some reason, but it is not that How do i want it

I have this before - try to clean and rebuild

No comments:

Post a Comment