Snapping elements / conditional layouts

Posted by Felix on Stack Overflow See other posts from Stack Overflow or by Felix
Published on 2010-04-14T12:11:51Z Indexed on 2010/04/14 12:13 UTC
Read the original article Hit count: 128

Filed under:
|

Sorry for the extremely bad title, I have no other idea what to call this question. What I'm trying to do is this: have a RelativeLayout which has two children:

  1. one with layout_centerInParent="true"
  2. one with layout_alignParentBottom="true"

However, when the device is in landscape mode, element (1) appears slightly over or under element (2). But, element (1) has enough space above it to appear above element (2). How could I make the layout so that if the screen is too small to center element (1) and make both elements not overlap, then align element (1) above (as in layout_above) element (2)?

© Stack Overflow or respective owner

Related posts about android

Related posts about android-layout