Ratio Justification
parentTop
/parentLeft
justification:
viewJustify
parentTop, parentLeft, topRatio, leftRatio, rightRatio, bottomRatio
viewBounds
{top: 0, left: 0, bottom: 25, right: 25}
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 0% to 25% horizontally (and vertically) of the parent's width (height). Strictly speaking, the topRatio
and leftRatio
are unnecessary since 0 interpreted as a percentage is still 0. Nonetheless, it is probably clearer to always set both left and right (or both top and bottom) ratios.
FIGURE 5.26 : A parent view with a child taking up its top 25% and left 25%.
parentBottom
/parentRight
justification:
viewJustify
viewBounds
parentBottom
justification means that the top of the child view starts at 0. The bottom of the view ends at 25. Similarly, the left of the child view starts at 0 and the right ends at 50.Yet another way is to use full justification:
viewJustify
, topRatio, leftRatio, rightRatio, bottomRatio
viewBounds
viewJustify
, topRatio, leftRatio, rightRatio, bottomRatio
viewBounds
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996