O'Reilly logo

Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming by Erica Sadun, Rod Strougo, Maurice Sharp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Changing Label Constraints

The app is now shown in German, but there is still one issue. To see this, run the app on the simulator and rotate to landscape. As you can see in Figure 5-10, the translated Total Cars label is too long.

Image

Figure 5-10 Translated label drawn outside of the container view

The core problem is the translated string is too large to fit on one line in the space provided by the add car group. Normally, you would expect to see a truncated string with a continuation character, something like “Anzahl aller Au...”.

The reason is the width of the label is not constrained to the width of its container. The resulting frame extends ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required