Answer the question
In order to leave comments, you need to log in
Android, How to make an element always visible?
and so there are 2 lists, initially hidden, opened by pressing the buttons "A" and "B".
How to make it so that if there is a lot of information (lines) in list A, then the button "B" does not leave the screen, but is at the bottom.
ps lists are mutually closed on click i.e. if A is open then B is closed and vice versa
Answer the question
In order to leave comments, you need to log in
RelativeLayout, something like this:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<ListView
android:id="@+id/list1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/button1"
android:layout_above="@+id/button2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/list2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<ListView
android:id="@+id/list2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question