Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to display a popup windows with transparent background image?
    primarykey
    data
    text
    <p><img src="https://i.stack.imgur.com/qyYpM.png" alt="enter image description here"></p> <p>Hello guys , i am making a application in which I display pop up-windows with background image,</p> <p>the background image i set to the popup window is transparent image but the problem is that when the popup window is displayed the background image is not displayed properly....</p> <p>although it is a transparent image it displays the black strip around the corner of image..</p> <p>can anybody help me out ??</p> <p>PopupDemoActivity.java</p> <blockquote> <p>package com.demo.popupwindow.;</p> </blockquote> <pre><code>import android.app.Activity; import android.os.Bundle; import android.view.Gravity; import android.view.View; import android.widget.Button; import android.widget.FrameLayout; import android.widget.LinearLayout.LayoutParams; import android.widget.PopupWindow; public class PopupDemoActivity extends Activity { Button searchMenu, viewOrder; PopupWindow popUp; LayoutParams params; FrameLayout layout; // LinearLayout layout; boolean click = true; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.popdemodemo); searchMenu = (Button) findViewById(R.id.menu); viewOrder = (Button) findViewById(R.id.order); popUp = new PopupWindow(this); // layout = new LinearLayout(this); layout = new FrameLayout(this); viewOrder.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { if (click) { popUp.showAtLocation(layout, Gravity.TOP | Gravity.RIGHT, 0, 0); popUp.update(30, 75, 500, 400); click = false; } else { popUp.dismiss(); click = true; } } }); // popUp.setContentView(layout); params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); layout.setBackgroundResource(R.drawable.order_back); // layout.setBackgroundColor(Color.TRANSPARENT); popUp.setContentView(layout); } } </code></pre> <p>popupdemo.xml</p> <blockquote> <p></p> </blockquote> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/white_color" android:orientation="vertical" &gt; &lt;RelativeLayout android:id="@+id/header_lay" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" &gt; &lt;Button android:id="@+id/menu" android:layout_width="200dp" android:layout_height="wrap_content" android:layout_marginLeft="30dp" android:text="Search Menu" android:textColor="@color/white_color" android:textSize="25sp" android:textStyle="bold" /&gt; &lt;Button android:id="@+id/order" android:layout_width="200dp" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_marginRight="30dp" android:text="View Order" android:textColor="@color/white_color" android:textSize="25sp" android:textStyle="bold" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload