Reputation: 7746
I have a UIView and inside that there is a subview which is UIView again, inside that UIView i want to add a UILabel at the centre , I am using Autolayout. I have added all the constraints to all the views , but UILabel at the centre is only visible on iPad screens, it goes missing on smaller screen, my doubt is, when its coordinates, when are calculated on resized parent UIView, turns out to be wrong or it gets squeezed so much that it becomes invisible.
Please help me on this, I am not an expert in auto layout so obvious. Thanks
Also the outer UIView will be presented fullscreen in parent ViewController
Upvotes: 0
Views: 943
Reputation: 27428
set leading,trailing,horizontal center in container and top constrain to label with it's container view.
Upvotes: 1
Reputation: 14571
And this is my Layout in all screens
Where your label is centered and also the Black View is increasing height with aspect ratio as per the device's height
Upvotes: 1
Reputation: 89
You should align it horizontally in the container.and also no one will be able to help unless you show all the constraints.
Upvotes: 0