loading... Loading...

Using Weight in Linear Layout


As part of our ongoing tutorials on using Cracker9, today we will cover using Weight in Linear Layouts.



In Cracker9, you will find the Design Toolbar near the top of the screen:

Weights in Cracker9 can be set for Linear and Constraint Layouts. The way Weights are used are different for the two Layouts: for Linear Layouts, the parent View must be selected; for Constraint Layouts, child Views must be selected (more on the Constraint Layout in our next post).

Lets take a look at how we set Weights in Linear Layouts.



STEP 01 >

Drag the View into the Design Panel



STEP 02 >

Set the Layout value to Linear Horizontal in the Setting Panel on the right.



STEP 03 >

Select the Weight Horizontal button from the Design Toolbar.



STEP 04 >

In Weight Edit Mode (as shown below), select the areas which are variable. When you click on the number box, it will change to arrows. The arrows indicate variable areas.



STEP 05 >

Select Save.



STEP 06 >

Check the Weight value under the Weight list in the Setting Panel on the right.



STEP 07 >

Select Generate Code in the Setting Panel.



STEP 08 >

Check the generated code in the Code Result Panel.

Using Weight in Linear Layout

Cracker9 aims to continue helping designers and developers concentrate on being creative.
For further information on Cracker9, please feel free to contact us directly: hello@cracker9.io


Back to list
Send message