RAHULRSANNIDHI
RAHULRSANNIDHI

Reputation: 537

PopupWindow showing a border

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

enter image description here

How do I remove it?

Upvotes: 7

Views: 9020

Answers (3)

Lavekush
Lavekush

Reputation: 6166

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

Upvotes: 0

Aspicas
Aspicas

Reputation: 4497

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"
/>

<!-- ..................... -->

Upvotes: 3

Farouk Touzi
Farouk Touzi

Reputation: 3456

Try to add this line :

mPopup.setBackgroundDrawable(new BitmapDrawable());

Upvotes: 24

Related Questions