I have created a custom dialog using AlertDialog.builder
. In this dialog, I am not displaying the title. All works fine but there is a black border in the dialog. So can anyone tell me how can I remove this black border? The code and screenshot are below.
Code in 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
Without creating a custom background drawable and adding a special style just add
one line to your code:
dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
More About Dialogs :
Dilaogs
Change this line of code
AlertDialog.Builder start_dialog = new AlertDialog.Builder(this);
to
AlertDialog.Builder start_dialog = new AlertDialog.Builder(this).setInverseBackgroundForced(true);
you will be all set
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With