1

If anyone have Google+ App can certainly understand what I'm trying to implement.
(explained here: UIViewController Containment with animation like Google+)

I think it has something related with the new effect in iOS 7 Calendar App.
(explained here: Recreating iOS 7 Calendar UIView Animation)

-

This is a common animation effect that I'm seeing in many apps these days.

Months ago, the fellow Rob tried to help me with this his answer:

Now I was trying to implement it but there's a problem. Images explains better:


INITIAL STATE

enter image description here

WHAT HAPPEN WITH CURRENT IMPLEMENTATION

enter image description here

WHAT SHOULD HAPPEN

enter image description here

I've created a super simple project that shows the implementation (few lines).

Can someone help me to find where's the problem?

REPO: https://github.com/socksz/MovingTableViewCellContent

Community
  • 1
  • 1
Fred Collins
  • 5,004
  • 14
  • 62
  • 111

1 Answers1

1

The problem is that you're trying to change the view's frame with Auto Layout on. You can't do that. The Auto Layout system will overwrite your changes. Try turning off Auto Layout in your storyboard and you'll see that it works.

So your options are:

  1. Don't use Auto Layout
  2. Use/manipulate constraints instead of frames.

For (2) you can just go into the storyboard and set up width and height constraints on the container view and it will work. If fixed size isn't the exact behavior you want, you'll need to be more explicit in your requirements.

The default constraints you're getting now are attached to the parent view and aren't getting carried along for the ride when you move the view to a new parent.

Timothy Moose
  • 9,895
  • 3
  • 33
  • 44
  • Timothy, I want to use AutoLayout in the rest of my application. How to handle that? However I can't get why it doesn't worw because AutoLayout is on but there are 0 contraints. – Fred Collins Oct 12 '13 at 19:13
  • You're getting default constraints. – Timothy Moose Oct 12 '13 at 20:56
  • Thanks @Timothy. What about if the contraints that are set up when the `UIVIews` are in `UITableViewCell` are different from the constraints I would when these `UIViews` will move up to the new super view? – Fred Collins Oct 12 '13 at 23:37