I\'ve a RelativeLayout thus:
RelativeLayout
// <-- View.VISIBLE OR View.GONE <
You can use this tag:
android:layout_alignWithParentIfMissing="true"
From the docs:
If set to true, the parent will be used as the anchor when the anchor cannot be be found for layout_toLeftOf, layout_toRightOf, etc.