android layout - Listview header formatting does not format buttons -


A header with two buttons has been added in a listview. You can see "None" and "All" buttons below the action, then follow the first item of the list. The button must be centrally located and take the position of the equivalent.

Enter image details here

I have a footer There is a similar solution (snapshot from different list view) where it works, you can see below the list, and then two buttons are distributed horizontally.

Enter image here description

is the code from the header :

  & lt; LinearLayout xmlns: android = "http://schemas.android.com/apk/res/Android" xmlns: tools = "http://schemas.android.com/tools" Android: layout_width = "match_parent" Android: layout_height = "Wrap_content" Android: divider = "? Android: dividersual" Android: weightSum = "1" Android: Show Divider = "Medium" Android: Orientation = "Horizontal" & gt; & Lt; Button Android "Android: attr / buttonBarButtonStyle" id = "@ + id / btn_none" style = Android: Layout_height = "Wrap_content" Android: layout_width = "0dp" Android: layout_weight = "0.5" Android: layout_marginLeft = "16" Android : Layout_margin right = "16" Android: text = "@ string / btn_on" /> & Lt; Button android: id = "@ + id / btn_all" style = Android: layout_marginLeft = "16" Android: layout_marginRight = "16" Android: layout_height = "wrap_content" Android: layout_width = "" Android attr / buttonBarButtonStyle? "0 DP" Android: layout_weight = "0.5" Android: text = "@ string / btn_all" /> & Lt; / LinearLayout & gt;  

I also tried the relative layout, but then it only works in the footer and not at the top. How do I adjust the buttons in the header?

Here is the footer code. It includes an additional view to establish a horizontal line

   & Lt; LinearLayout Android: Layout_width = "Match_parent" Android: Layout_height = "Wrap_content" android: divider =: android: orientation = "horizontal" android: ShowDividers = "Medium" Android "Android dividerVertical?" WeightSum = "1" & gt; & Lt; Button Android "Android: attr / buttonBarButtonStyle" id = "@ + id / dts_btn_cancel" style = Android: layout_width = "0dp" Android: Layout_height = "Wrap_content" Android: layout_weight = "0.5" android: text = "@ string / Btn_counter "/> & Lt; Button Android "Android: attr / buttonBarButtonStyle" id = "@ + id / dts_btn_done" style = Android: layout_width = "0dp" Android: Layout_height = "Wrap_content" Android: layout_weight = "0.5" android: text = "@ string / Btn_done "/> & Lt; / LinearLayout & gt; & Lt; / LinearLayout & gt;  


Comments

Popular posts from this blog

c# - Process.Kill() returns access denied -

c# - NewtonSoft JArray - how to select multiple elements with LINQ -

c# - Using the generic type 'System.Collections.Generic.List<T>' requires 1 type arguments -