【发布时间】:2012-08-02 21:46:22
【问题描述】:
我正在尝试使用图像文本和按钮创建自定义 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();
}
如您所见,topborder 和图像有 2-3 px 的空间。
【问题讨论】:
-
白钻是什么意思?
-
只是一个边框。 alertDialog 中的边框(默认为白色边框)
-
你可以用Dialog代替Alert..?
-
当然,如果我可以删除文件夹:(。但所有人都说我必须在 alertdialog 中创建自定义。(用于图像而不是标题)。我想要垂直样式:图像(而不是标题) , text1,text2,text3,btn1,btn2 ....
-
你可以在对话框中添加任何你想要的布局..
标签: android android-alertdialog