popupwindow加白色背景框后,边缘出现黑线

lwl844059061 2011-08-03 02:00:07
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);
}
}

...全文
1529 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
toby2021 2013-08-05
  • 打赏
  • 举报
回复
把PopupWindow的background设置为null就可以了, popupWindow.setBackgroundDrawable(null);
lwl844059061 2011-08-03
  • 打赏
  • 举报
回复

楼上说的不行啊,这布局图片有问题吗
刍狗万物 2011-08-03
  • 打赏
  • 举报
回复
楼主你的popupwindow的高度和宽度在R.layout.popup里面设置那个linearlayout的就行了
再把popupwindow的高度改成自适应来适应它
应该就可以了。。
personal_popupWindow=new PopupWindow(this.getLayoutInflater().inflate(R.layout.personal_popupwindow, null),
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
如果这样不行就是你布局有问题了。。。
刍狗万物 2011-08-03
  • 打赏
  • 举报
回复
你载入的那个布局有问题。我用popupwindow就没试过黑线的。
一般布局出现的东西不干代码的事..
lwl844059061 2011-08-03
  • 打赏
  • 举报
回复
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>
redoffice 2011-08-03
  • 打赏
  • 举报
回复
目测是R.layout.popup你这个里面写的问题,把XML文件发上来看看。

80,337

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧