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

 Inspector

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:

 Enter the image details here

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

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -