Reputation: 25938
I have one independent view(green view) on xib and want to set height and width with auto-layout of below green view:
Note: I don't want to apply Auto-layout with code.
Upvotes: 0
Views: 95
Reputation: 8193
You cannot do what you want without creating a relationship between your "Main View" and your custom view (your green view). Some additional steps are needed:
Check this tutorial for a complete working example.
Upvotes: 1
Reputation: 4160
I think you should add constraints programmatically (or add the view in interface builder and change it's visibility but it's not good). You're trying to set constraints between green view and controller main view, but green view still not know which is its superview. That's not possible from interface builder.
Upvotes: 0
Reputation: 3199
you can't set constraints between views which are not related. They must be in the same view hierarchy. So I believe you can't do it in the interface builder like you want..
Upvotes: 1