objective c - How to keep subview's position relative to its parent view? -
I have a parent view (UIView), which has 2 buttons (UIButton), these buttons are always under the original view Now, when I do an animation to see the parents (as it increases its height), I want these 2 buttons to maintain their last relative position (should be below).
In the shape inspector, I set the origin of the button like
However, does it not work, is there a simple solution for this? I do not want to write it in the code, because I have so many sub thoughts, and want to maintain their relative position compared to the parents' view. It's hard work to do this manually in code.
Note: I am using encoded 5, iOS 7
if If you are using Xcode 5, you can use the new auto-layout button in the IB:
Then you can pin your thoughts in the bottom of the original view in the same way as you would in the size inspector, you may have to add extra constraints, But Xcode do this for you Could.
Comments
Post a Comment