Пример #1
0
        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 DidTransitionToState (UITableViewCellState mask)
		{
			base.DidTransitionToState (mask);

			//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 ((mask & UITableViewCellState.ShowingDeleteConfirmationMask) != 0) {
				var deleteButton = Subviews.Last();
				deleteButton.Alpha = 0;
			}
		}
Пример #4
0
        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;
            }
        }