UILabel positioning different when text is present vs when text isn't present

Here is the picture of exactly how I want the view to be positioned (I even have constraints set up in the interface builder)

Below are the images for what I want it to look like and how it is set up in interface builder (pic # 1)

The second one is the interface at runtime.

Note: Once the labels actually get textual data during runtime, the view expands to give the labels the space (i.e. just like the first picture)

My goal is to eliminate this "animated movement". I want the view/progress bar/everything to remain static once it has been situated at runtime and not bouncing up and down if data is in the labels or if it isn't.

I do NOT want to use a stack view because iOS 7 is not supported with that feature or I would.

UILabel positioning different when text is present vs when text isn't present

UILabel positioning different when text is present vs when text isn't present

Note: It's different colors, but the same view with the problem shows as stated in the question. I was lazy and don't want to explain myself how I was lazy and why they are different...

Replay

You should add the height constraint with some constant, e.g. 20, and relation "greater or equal" to each of your labels. This way autolayout will know exact height needed before label text is set, and this will allow your labels to stretch vertically if text is too long for one line

Category: ios Time: 2016-01-16 Views: 1

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.194 (s). 12 q(s)