popupwindow加白色背景框后,边缘出现黑线,怎么才能去掉,求各位大侠帮忙
代码:
public class MusicPopup2 {
private PopupWindow music;
        private View vt;
        private Context context;
        private int width=70;
        private int height=145;
                public MusicPopup2(Context c) {
                context = c;
              View ebook_popwindow_music = View.inflate(context, R.layout.popup, null);
//R.layout.popup是一个带背景的LinearLayout
        music = new PopupWindow(ebook_popwindow_music, width,height);
            }
public void show(View parent) {
        vt=parent;
        music.showAtLocation(vt, 0, 580, 809);
}
}

解决方案 »

  1.   

    目测是R.layout.popup你这个里面写的问题,把XML文件发上来看看。
      

  2.   

    popup.xml的内容android:background="@drawable/musicback"中musicback是一个纯白色背景图片,popupwindow是在一个用来显示图片的Activity上弹出来的,求各位大侠帮忙<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="70px"
      android:layout_height="145px"
      android:orientation="vertical"
      android:background="@drawable/musicback">
      <LinearLayout
       android:layout_width="70px"
     android:layout_height="137px"
      android:orientation="vertical">
    <ImageButton 
    android:id="@+id/imagebutton_ebook_popwindow_bottomtitle_random" 
    android:layout_height="58px" 
    android:layout_width="58px"
    android:layout_marginLeft="8px"
    android:layout_marginTop="5px"
    android:background="@drawable/random1" 
    ></ImageButton>
    <ImageButton 
    android:id="@+id/imagebutton_ebook_popwindow_bottomtitle_repeat" 
    android:layout_height="58px" 
    android:layout_width="58px"
    android:layout_marginLeft="8px"
    android:layout_marginTop="5px"
    android:background="@drawable/repeat1" 
    ></ImageButton> 
    </LinearLayout>
      </LinearLayout>
      

  3.   

    你载入的那个布局有问题。我用popupwindow就没试过黑线的。
    一般布局出现的东西不干代码的事..
      

  4.   

    楼主你的popupwindow的高度和宽度在R.layout.popup里面设置那个linearlayout的就行了
    再把popupwindow的高度改成自适应来适应它
    应该就可以了。。
    personal_popupWindow=new PopupWindow(this.getLayoutInflater().inflate(R.layout.personal_popupwindow, null), 
    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    如果这样不行就是你布局有问题了
      

  5.   

    把PopupWindow的background设置为null就可以了,
    popupWindow.setBackgroundDrawable(null);