Mr Coder
Mr Coder

Reputation: 8186

Whats the diff between setting top=0,bottom=0,left=0,right=0 OR width=100% , height=100%

the child component can take all its parent width and height by setting its properties

top=0,right=0,bottom=0,left=0

But same can be done by setting the child component properties

width=100%,height=100%

so whats the difference between these two approaches ?? plz give advantages/disadvantages if possible .thx in advance.

Upvotes: 1

Views: 563

Answers (2)

sshongru
sshongru

Reputation: 896

Measuring GraphicElements with strokes is slightly different between using width/height and constraints. This blog post explains in more detail: http://flexponential.com/2010/03/14/measuring-a-graphicelement-with-a-stroke-in-a-group/

Upvotes: 0

James Ward
James Ward

Reputation: 29433

They both have the same effect in a BasicLayout. The only different might be in performance. In other layouts like VerticalLayout and HorizontalLayout I don't think the constraints (top, right, etc) have any effect, but the percentage values do.

Upvotes: 1

Related Questions