我正在尝试创建带有图像文本和按钮的自定义AlertDialog。当我显示它时,会出现一个看起来很糟糕的白色边框。
如何去掉那个白色边框?
以下是我的自定义对话框:
如何去掉那个白色边框?
以下是我的自定义对话框:
public LinearLayout customeLL;
public void alertD()
{
AlertDialog ad;
AlertDialog.Builder builder;
Context mContext = getApplicationContext();
TextView a = new TextView(getApplicationContext());
a.setText("Test dialog");
ImageView img = new ImageView(getApplicationContext());
img.setBackgroundResource(R.drawable.bottombar_bg);
LinearLayout customeLL = new LinearLayout(getApplicationContext());
customeLL.setOrientation(LinearLayout.VERTICAL);
customeLL.addView(img,curWidth,37);
customeLL.addView(a,curWidth,37);
builder = new AlertDialog.Builder(myClass.this);
builder.setView(customeLL);
ad=builder.create();
ad.show();
}
正如您所看到的,顶部边框和图像之间有2-3像素的间隙。