【发布时间】:2020-06-25 15:24:51
【问题描述】:
我使用AlertDialog.builder 创建了一个自定义对话框。在此对话框中,我没有显示标题。一切正常,但对话框中有黑色边框。那么谁能告诉我如何删除这个黑色边框?代码和截图如下。
java代码:
AlertDialog.Builder start_dialog = new AlertDialog.Builder(this);
Context mContext = getApplicationContext();
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.custom_dialog2,
(ViewGroup) findViewById(R.id.layout_root));
layout.setBackgroundResource(R.drawable.img_layover_welcome_bg);
Button btnPositiveError = (Button)layout.findViewById(R.id.btn_error_positive);
btnPositiveError.setTypeface(m_facedesc);
start_dialog.setView(layout);
final AlertDialog alert = start_dialog.create();
alert.show();
btnPositiveError.setOnClickListener(new Button.OnClickListener()
{
public void onClick(View v)
{
alert.dismiss();
}
});
ScrrenShot
【问题讨论】:
-
我已经删除了这样做的背景:stackoverflow.com/questions/8051581/…。这些问题可能我可以合并
标签: android android-alertdialog