Search code examples
androidandroid-layoutandroid-linearlayoutandroid-relativelayout

Overlapping in RelativeLayout


I have one RelativeLayout which contains 2 linearlayouts, one should always be aligned with bottom (for log out purpose.) and the other starts from top and contains 2 viewstubs. These two viewstubs have different heights any only one of them will be visible at same time.

My problem is if I make top linearlayout align top and bottom linearlayout align bottom, contents overlap if viewstubs height is bigger.

I can not make them above and below of any as if the viewstubs height is smaller views start not from the corners.

How can I avoid them from overlapping?


Solution

  • Use 3 LinearLayouts set the center layout as it is which you have done above/below and add that centered layout into scroll view after it still your problem do not solve so just let me know :) Happy coding.