loading... Loading...

Using Weight in Linear Layout

1056

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.
Linear_W04

 

 

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.
Linear_W05

 

 

STEP 05 >

Select Save.

 

 

STEP 06 >

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

 

 

STEP 07 >

Select Generate Code in the Setting Panel.
Linear_W07

 

 

STEP 08 >

Check the generated code in the Code Result Panel.
Linear_W08

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
Login
Register
Send message