Skip to content Skip to sidebar Skip to footer

Android RelativeLayout And Height Of Wrap_content?

I am trying to make a selection ListActivity, similar to the one used to add shortcuts to the launcher screens. I have rolled my own header and footers, which I would like to be 's

Solution 1:

According to the developer documentation your desired behaviour is not possible for Relative layout ;

"Note that you cannot have a circular dependency between the size of the RelativeLayout and the position of its children. For example, you cannot have a RelativeLayout whose height is set to WRAP_CONTENT and a child set to ALIGN_PARENT_BOTTOM."

RelativeLayout

To solve your problem you could maybe try to use a linear layout, set to wrap_content and set max height via code to screen height.

You can get the screen height as described here : get screen height


Solution 2:

I just change my RelativeLayout in FrameLayout and all starts to work


Post a Comment for "Android RelativeLayout And Height Of Wrap_content?"