ios - Horizontally Center UILabel + UIImageView inside UIView with Autolayout -
first problem:
i have uiview contains uilabel (dynamic text) + uiimage. want them centered inside uiview. these images:
the answer here out of date , have stack view maybe can make task easier.
second problem:
i have 3 uiview's next each other each 1 has uiimageview + uilabel should centered in container (problem 1). in iphone 4s has small width screen text breaks layout, in image :
i use xcode 7.0 | target ios8 , above | swift 2
this pretty easy in pure autolayout/ib no code. ends looking this: 
here's storyboard file view can see constraints easily. uses same subview wrapper technique, trick getting labels shrink/cut off needed adding >= 0 constraints both sides of wrapper view, keeping expanding past borders of parent view, in turn keeps label growing.
https://www.dropbox.com/s/ml67zdjwugf8jco/so_solution-20151013.storyboard?dl=0



Comments
Post a Comment