Changes

Jump to: navigation, search
Weighted Chain
== Weighted Chain ==
The final area of chains to explore involves weighting of the individual widgets to control how much space each widget in the chain occupies within the available space. A weighted chain may only be implemented using the spread chain style and any widget within the chain that is to respond to the weight property must have the corresponding dimension property (height for a vertical chain and width for a horizontal chain) configured for match constraint mode. Match constraint mode for a widget dimension may be configured by selecting the widget, displaying the Attributes panel and changing the dimension to match_constraint. In Figure 26-8, for example, the layout_width constraint for button1 has been set to match_constraint to indicate that the width of the widget is to be determined based on the prevailing constraint settings:  [[File:]] 
Assuming that the spread chain style has been selected, and all three buttons have been configured such that the width dimension is set to match the constraints, the widgets in the chain will expand equally to fill the available space:

Navigation menu