SwipeRevealLayout icon indicating copy to clipboard operation
SwipeRevealLayout copied to clipboard

Children layout_height="match_parent" does not work

Open calkinssean opened this issue 7 years ago • 7 comments

I may be doing something wrong, but I cannot for the life of me get this to work. Only the first child of the swipe review layout seems to match parent height or width correctly, otherwise they all function as if I put wrap_content.

calkinssean avatar Sep 14 '17 17:09 calkinssean

I have an update to this issue. For some reason, when using match_parent for height in the swipe view instead of wrap_content, my view height is 0

calkinssean avatar Sep 14 '17 20:09 calkinssean

@calkinssean do you know what the solution would be?

oec08 avatar Sep 14 '17 22:09 oec08

@oec08 as of right now, no. I ended up using hard coded sizes but it makes it so the extra buttons won't dynamically change size if the cell gets bigger.

calkinssean avatar Sep 15 '17 00:09 calkinssean

I noticed the same problem and had to use fixed sizes.

PioBeat avatar Sep 19 '17 17:09 PioBeat

@calkinssean would you mind creating a PR to try and get that bug fixed? I've been forced to use a view tree observer. Not ideal but much better than hardcoding height values in my case.

notandyvee avatar Oct 22 '17 06:10 notandyvee

@calkinssean try invoke requestLayout() on children after drawing layout. It works well for me

Shhatrat avatar Dec 01 '17 08:12 Shhatrat

The solution for me was to replace children from RelativeLayout to LinearLayout

ahlem-jarrar avatar Mar 16 '18 09:03 ahlem-jarrar