Zigglzworth
Zigglzworth

Reputation: 6803

iOS - Interface Builder - Adding elements as subviews to a UIView

In interface builder I have a viewController and It's main view (view A). I have added another UIView (view B) onto the main view and now I would like to add more elements to view B but I want Xcode to recognize them as subviews of view B rather than subviews of view A.

When you drag elements onto a view in interface builder they initially are added to the main view. You can then drag and move them to be under another view in the interface builder navigator but they still don't seem to become subviews of that view.

Any ideas?

Upvotes: 0

Views: 1530

Answers (1)

Lithu T.V
Lithu T.V

Reputation: 20021

Add inside/under view B in xib.It will make the elements added to view B the subviews of view B only,not view A

This way it will look

enter image description here

Upvotes: 2

Related Questions