Popupwindow shows the border

When creating a Popupwindow, it shows the border as shown below: enter image description here How to remove it?

suggest a solution.

+4
source share
3 answers

Try adding this line:

mPopup.setBackgroundDrawable(new BitmapDrawable());
+20
source

You can create one custom style and put this border on the same color in the 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 Android XML Extractable File in 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"
/>

<!-- ..................... -->
+1
source

,

.

. 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>

:

Border

0

Source: https://habr.com/ru/post/1541740/


All Articles