I have a UIView
in my layout that is pinned to the sides of my VC. Inside of that I have an icon UIImageView
and a UILabel
that is next to that. I would like both of those to be center aligned inside of the UIView
no matter how long the text inside of the label is. (Similar to how you would use text-align:center; in CSS to align both image and text center).
| UIView |
| |
| |
| |
| |image| |label| |
| |
| |
| |
| |
Sometimes the label might be long, but I still need them centered:
| UIView |
| |
| |
| |
| |img| |label is long| |
| |
| |
| |
| |
I know how to use Autolayout
but this one has me stumped since I can't created a "holder" UIView
and center that. I need some help figuring out the constrains to add in IB.
Ideas?