Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
C# — Custom Xamarin.Forms renderer for TableView to hide empty cells at the bottom
// NoEmptyRowsTableViewRenderer.cs
// No Rights Reserved
// Assume you have `MyProject.MyTableView` sublass of
// `Xamarin.Forms.TableView` and want to hide extra
// empty rows at the bottom. All you need on iOS is to set
// `TableFooterView` to empty `UIView` in custom renderer.
// Will work for ListView, just replace TableViewRenderer with
// ListViewRenderer.
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using UIKit;
using CoreGraphics;
[assembly: ExportRenderer(typeof(MyProject.MyTableView),
namespace MyProject.iOS
public class NoEmptyRowsTableViewRenderer : TableViewRenderer
protected override void OnElementChanged(ElementChangedEventArgs<TableView> e)
if (Control != null)
Control.TableFooterView = new UIView(CGRect.Empty);

This comment has been minimized.

Copy link

@VansW VansW commented Nov 29, 2018


Do you have any such renderer for android as well? How do we hide empty rows in android?


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment