7

When creating a PopupWindow it shows a border like in the following image:

enter image description here

How do I remove it?

Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
RAHULRSANNIDHI
  • 527
  • 6
  • 20

3 Answers3

24

Try to add this line :

mPopup.setBackgroundDrawable(new BitmapDrawable());
Farouk Touzi
  • 3,451
  • 2
  • 19
  • 25
3

You can create one custom style and put that border the same color on background, try something like:

New | Android XML File.

myborder.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> 
<stroke 
android:width="1dip" 
android:color="@android:color/darker_gray" /> 
<solid 
android:color="@android:color/background_dark" /> 
<padding 
android:left="7dip" 
android:top="7dip" 
android:right="7dip" 
android:bottom="7dip" /> 
<corners 
android:radius="6dip" /> 
</shape>

Using the drawable Android XML file in a layout

Layout.xml

<LinearLayout 
android:orientation="vertical"
android:background="@drawable/myborder"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Text"
/>

<!-- ..................... -->
Aspicas
  • 4,498
  • 4
  • 30
  • 53
0

You need to create a custom layout and set border of parent layout,

i'll giving you a Logical idea for doing this.

Your layout must be like below. dialog_layout.xml

<RelativeLayout>
    <LinerLayout>  <!-- You can **Set/Remove** all background properties of this LinearLayout-->

     <!-- Here are all child element like EditText/ Or TedxView-->

    </LinerLayout>
</RelativeLayout>

Here are link for border :

Border

Lavekush Agrawal
  • 6,040
  • 7
  • 52
  • 85