A
A
Alexander Popov2016-05-31 12:55:23
Android
Alexander Popov, 2016-05-31 12:55:23

Android, How to make an element always visible?

d0b3ef268e93460d9d3cfc76782c703f.png
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.
1ec208b7d2bb4f32aceefbd7965506d8.png
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

1 answer(s)
M
MikkiMouse, 2016-06-03
@MikkiMouse

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 question

Ask a Question

731 491 924 answers to any question