Home > DeveloperSection > Forums > How to set component from one superview to another without loosing frame & position in Xcode?
Mikki Halpin
Mikki Halpin

Total Post:23

Points:161
Posted on    April-04-2016 2:32 AM

 iPhone iPhone  Ios  Objective C 
Ratings:


 1 Reply(s)
 358  View(s)
Rate this:

I want to move a component from one superview to another superview  in our application. So, my question is can we move the component without loosing frame/position to be reset. Because in Xcode the default behaviour when doing this appears in center the view being moved vertically and horizontally in its new superview, while preserving its dimensions.

So, please tell me how can I move the component without loosing frame/position of component in another view?



Tarun Kumar

Total Post:210

Points:1614
Posted on    April-05-2016 3:20 AM

If you want to move any component from one view to another view the you need to Embed it after moving the component. Here, I am telling you the shortest solution, follow it:
1. FirstOfAll move the component,
2. Select the component that you are moved.
2. Now, go to you Xcode Tool bar, and select Editor > click on 'Embed In' > and after select the view type to embed in.

I hope it will solve your problem.


Don't want to miss updates? Please click the below button!

Follow MindStick