public override void DidTransitionToState(UITableViewCellState mask) { base.DidTransitionToState(mask); if (!Theme.IsiOS7) { //If the "delete" button is appearing, let's reposition it and use a different animation if ((mask & UITableViewCellState.ShowingDeleteConfirmationMask) != 0) { var deleteButton = Subviews.Last(); //Position the button var frame = deleteButton.Frame; frame.X -= 45; deleteButton.Frame = frame; //Animate the button "fading" in UIView.BeginAnimations("ShowDeleteButton"); UIView.SetAnimationDuration(.3); UIView.SetAnimationCurve(UIViewAnimationCurve.EaseInOut); deleteButton.Alpha = 1; UIView.CommitAnimations(); } else { //Animate the icon "fading" in UIView.BeginAnimations("ShowIcon"); UIView.SetAnimationDuration(.3); UIView.SetAnimationCurve(UIViewAnimationCurve.EaseInOut); icon.Alpha = 1; UIView.CommitAnimations(); } } }
public override void WillTransitionToState(UITableViewCellState mask) { base.WillTransitionToState(mask); //If the "delete" button is appearing, set the alpha to 0 so it is invisible if (!Theme.IsiOS7 && (mask & UITableViewCellState.ShowingDeleteConfirmationMask) != 0) { var deleteButton = Subviews.Last(); deleteButton.Alpha = 0f; } }
public override CGSize SizeThatFits(CGSize size) { Layout(); return(new CGSize(size.Width - 20, Subviews.Last().Frame.Bottom + 5)); }