0

In my Android App I have a view and on it a pop-up is opened at certain conditions.

How can I set it's position to be at the bottom? (anyhow above the other view).

Today's code just deals with Visibility 'gone' or 'hide'.

This is the popUp Xml:

<RelativeLayout
    android:id="@+id/alerterLayout"
    android:layout_width="248dp"
    android:layout_height="wrap_content"
    android:layout_marginTop="90dp"
    android:background="@drawable/popup_alerter_base"
    android:gravity="right"
    android:padding="0dp">

    <!--
    ========================================================================
    * Title Text
    =======================================================================
    -->

    <LinearLayout
        android:id="@+id/alerterTitleLayout"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:layout_alignParentTop="true"
        android:layout_marginTop="12dp"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="2dp"
        android:orientation="horizontal" >

...
Elad Benda
  • 35,076
  • 87
  • 265
  • 471

2 Answers2

2

Assuming you are talking about using PopupWindow, you can use showAtLocation(View v, int gravity, int x, int y) to get it in the desired spot with respect to whichever View you want.

You can play with the params to get the exact result you need.

codeMagic
  • 44,549
  • 13
  • 77
  • 93
0

You can take the layout inside the same xml file as in which you have defined your view, on top of which you need to show the pop-up. Then you can try to make the pop-up layout visible and invisible whenever you want to. Keep the initial visibility of Pop-up layout as GONE.

  • I would appreciate if I get a comment why my answer was down-voted, so that I can also know what was wrong in my answer. Thanks!!! –  Oct 02 '13 at 14:04