comment afficher une fenêtre pop-up avec arrière-plan transparent de l'image?

comment afficher une fenêtre pop-up avec arrière-plan transparent de l'image?

Bonjour les gars , je fais une application dans laquelle j'affiche pop-up windows avec une image d'arrière-plan,

l'image de fond je me mis à la fenêtre de l'image est transparente
mais le problème est que lorsque la fenêtre est affichée l'image de fond ne s'affiche pas correctement....

bien que c'est une image transparente, il affiche la bande noire autour du coin de l'image..

quelqu'un peut-il m'aider ??

PopupDemoActivity.java

package com.la démo.popupwindow.;

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);
}
}

popupdemo.xml

<?xml version="1.0" encoding="utf-8"?>
<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" >
<RelativeLayout
android:id="@+id/header_lay"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center" >
<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" />
<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" />
</RelativeLayout>

Postez votre fichier de mise en page de votre popup vue s'il vous plaît.

OriginalL'auteur Jayesh | 2012-12-03