Reputation: 58672
I'm trying to place a label on top of label next to my image.
I have tried
I had
I want these number to display here
Should I look into a stack or some short?
Upvotes: 0
Views: 262
Reputation: 347244
In this case, I might be tempted to just use a UIStackView
- it might be a little overkill, but one of the benefits is if you hide one of the labels (because it's text is nil) it will reduce the size of the StackView
, which, personally, makes the layout look nicer, but that's me
UIImageView
constraintsUIStackView
constraintsUIStackView
properties*nb: This still assumes that the overall height of the text won't exceed the height of the UIImageView
Upvotes: 2
Reputation: 1493
Based on your requirement, I created it in storyboard; u can do same like it to achieve your prototype :
Constraints for label 2 (Devices):
I hope it clears your doubt.
Upvotes: 1