Ratio Justification

Child in Bottom-Right Sixteenth of Parent

FIGURE 5.27 shows a parent view whose width is 200 and whose height is 100. It has one child which takes up its bottom-right sixteenth. The easiest way to accomplish this is (as always) to use parentTop/parentLeft justification:

viewJustify
parentTop, parentLeft, topRatio, leftRatio, rightRatio, bottomRatio

viewBounds
{top: 75, left: 75, bottom: 100, right: 100}

Each of the viewBounds slots are treated as percentages (due to the four ratio justifications) of the parent width/height. Therefore, the viewBounds are interpreted as ranging from 75% to 100% horizontally (and vertically) of the parent's width (height).

FIGURE 5.27 : A parent view with a child taking up its bottom 25% and right 25%.


An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996