Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PopupWindow showing a border

Tags:

android

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

enter image description here

How do I remove it?

like image 675
RAHULRSANNIDHI Avatar asked May 23 '14 09:05

RAHULRSANNIDHI


2 Answers

Try to add this line :

mPopup.setBackgroundDrawable(new BitmapDrawable());
like image 57
Farouk Touzi Avatar answered Oct 05 '22 15:10

Farouk Touzi


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

<!-- ..................... -->
like image 38
Aspicas Avatar answered Oct 05 '22 15:10

Aspicas