Next: 1.4 Introduction to basic Up: 1. Renaissance AutoLayout Previous: 1.2 Why using the

1.3 The basics of autolayout

Autolayout can be a very complex task. There are only a few basic requirements which all autolayout systems must implement:
  1. different objects in the window should not overlap - that is, the objects (for example buttons or textviews) should be displayed in separate areas of the window, and not one over the other one, as that would make part of one object disappear below the other one.

  2. each object has - usually - a minimum size needed to display, and no object should ever be sized to be smaller than this minimum size. For example, a 'Cancel' button should never be made smaller than the minimum size required to display the 'Cancel' string. But even this basic requirement is questioned in some autolayout systems - there are systems were buttons are allowed to become arbitrary small (till you can no longer read what they are about, and possibly not even push them!). Still, you can get this effect even on systems supporting a minimum size, by manually setting the minimum size of a button to zero. Renaissance AutoLayout does support (and encourage the use of) minimum sizes.

In theory, given those two basic requirements, not much more can be said: there are infinite ways of organizing the (auto)layout of a window. After all a window is just a rectangular area, and there are infinite ways you can layout your buttons and textfields inside this rectangular area, infinite relationships you may want to establish between the widths and heights and coordinates of those objects.

Renaissance provides you with support for some standard ways of organizing your objects, which should be enough to build most standard windows used in most software. But there is always the possibility that you could want/need to have some different relationships between the sizes and positions of your objects. If you are very much keen on establishing ratios between heights and widths and positions of all your objects, it's quite possible that you could end up with size and position constrains which can't be implemented using the standard Renaissance objects. In that case, you will need to implement your own autolayout objects, possibly subclassing or reusing in some other way standard Renaissance AutoLayout objects to cut down your work.


Next: 1.4 Introduction to basic Up: 1. Renaissance AutoLayout Previous: 1.2 Why using the
2008-03-19