3

I just started using SpriteBuilder and was wondering if something like “autolayout” (in a basic form) was possible for the apps? You see I have made this simple layout ( http://cl.ly/Szs3 ) containing a header (blue-ish) and body (red).

Now what I want is that the header has a fixed height (it has 100% percent width, so that goes wel) and the red block “fills” the rest of the screen. So when the device is a taller device more content at once can be shown.

Is this possible? And if so, how could I acchieve this.

Matthijn
  • 3,126
  • 9
  • 46
  • 69
  • not to my knowledge. I end up coding the 'relative offsets' from a base object for every other object as a function of device type and retina'ness ... but i'll be watching the answers on this question :) – YvesLeBorg Dec 17 '13 at 15:47

2 Answers2

1

Yes there is such an option, yet the naming is a little bit different.

I uploaded my example project to this GitHub Repo: https://github.com/MakeGamesWithUs/Spritebuilder-Simple-Autosizing

Your top container needs a static height, and a relative position and a Y Anchor Point of 1. This way the top container always has a size of 100 points and is always positioned at the top of the screen: enter image description here

Your bottom container needs a height inset of 100, this means your container will use the complete height of the parent container, except for 100 points at the top:

enter image description here

Ben-G
  • 4,996
  • 27
  • 33
0

You can take a look at:

yoAlex5
  • 29,217
  • 8
  • 193
  • 205