Time for action – using the Geometry Manager to position buttons

We'll add some buttons to the stack that we are currently working on:

  1. Take the first four buttons and duplicate them to get another set of four buttons below the previous ones.
  2. Select the first of the new buttons and in the Geometry section of the Inspector palette, click once on the vertical bar and twice on the horizontal bar; you will end up with the state shown in the previous screenshot.
  3. Do the same for the other three buttons.
  4. Try resizing the card window.

What just happened?

That was quite a quick test, and if all went well, you will see that resizing the card window includes positioning the first four buttons using the resizeStack handler that we added, and it's positioning of the second set of four buttons using the Geometry Manager. With the settings we used, the results should be much the same, except that the second set of four buttons will remain a fixed distance away from the bottom of the card window.

There is a lot of power in the Geometry Manager and you should take a look at the other abilities it has at the reference link shown at the end of this chapter. However, it is not the best way to deal with mobile screen sizes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset