Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save martinbowling/792476 to your computer and use it in GitHub Desktop.
Save martinbowling/792476 to your computer and use it in GitHub Desktop.
Move the UITableViewCellDeleteConfirmationControl on a UITableViewCell
public override void LayoutSubviews ()
{
// LayoutSubviews is called each time that we enter Editing Mode, So Lets Take This Opportunity To
// Show or Hide any elements we want
base.LayoutSubviews();
if (this.Editing)
{
this.DetailTextLabel.Hidden = true;
IntPtr sel = Selector.GetHandle ("description");
//IntPtr sel = Selector.GetHandle ("class");
foreach (var v in this.Subviews)
{
//Console.WriteLine(v.Handle.ToString());
NSString desc = (NSString) Runtime.GetNSObject (Messaging.IntPtr_objc_msgSend (v.Handle, sel));
if (desc.ToString().IndexOf("<UITableViewCellDeleteConfirmationControl") >= 0)
{
RectangleF rect = new RectangleF(v.Frame.X - 60, v.Frame.Y - 5, v.Frame.Width + 60, v.Frame.Height + 10);
v.Frame = rect;
}
Console.WriteLine(desc.ToString());
}
}
else
this.DetailTextLabel.Hidden = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment