Created
January 23, 2011 21:50
-
-
Save martinbowling/792476 to your computer and use it in GitHub Desktop.
Move the UITableViewCellDeleteConfirmationControl on a UITableViewCell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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