Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

How do I remove the divider line of the TableSectionHeader in Android?

$
0
0

Hello,

In Android I have 3 TableSections.
Every TableSection has a TableSectionHeader with a divider line.
I have the following custom renderer which hides the header, but I cannot remove the divider line.
See also the attachment, the blue lines.

//Used to clear empty headers in TableView for sections without a specified title********
[assembly: ExportRenderer (typeof(TextCell), typeof(TableSectionHeaderRenderer))]
public class TableSectionHeaderRenderer : TextCellRenderer
{
protected override Android.Views.View GetCellCore (Cell item, Android.Views.View convertView, ViewGroup parent, Context context)
{
// Hide cells of TableSections with no title.
var view = base.GetCellCore (item, convertView, parent, context) as ViewGroup;
if (String.IsNullOrEmpty ((item as TextCell).Text)) {
view.Visibility = ViewStates.Gone;
while (view.ChildCount > 0) {
view.RemoveViewAt (0);
}
view.SetMinimumHeight (0);
view.SetPadding (0, 0, 0, 0);
}
var textCell = (TextCell)item;
return view;
}
}


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>