Skip to content

Commit 55df90f

Browse files
authored
Update RelativeLayout.java
allocateRelativeSpace method needs to check the visibility of the component before allocating space.
1 parent 140a638 commit 55df90f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/RelativeLayout.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,8 @@ private int[] allocateRelativeSpace(Container parent, int spaceAvailable, float
616616
Component component = parent.getComponent(i);
617617
Float constraint = constraints.get(component);
618618

619-
if (constraint != null)
619+
// if (constraint != null)
620+
if (constraint != null && component.isVisible())
620621
{
621622
int space = (int)(Math.round(spaceAvailable * constraint.floatValue() / relativeTotal));
622623
relativeSpace[i] = space;

0 commit comments

Comments
 (0)