I want to get rid of the border in my dialog box and make it look absolutly transparent, as if the image is on the top of screen.
try this:-
final Dialog dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dialog.setContentView(R.layout.splash);
dialog.show();
The simplest way of doing this is that in your DialogFragment's onCreate() method, call
setStyle(DialogFragment.STYLE_NO_FRAME, 0);
And if the view you returned in onCreateView does not have a background specified, the dialog's background will be just transparent.
Why? DialogFragment.STYLE_NO_FRAME means that OS will not do any drawing in the window of the dialog, and your view is 100% responsible for drawing everything about the dialog.
To give a translucent effect, say 50% opacity, use:
Drawable d = new ColorDrawable(Color.BLACK);
d.setAlpha(130);
mDialog.getWindow().setBackgroundDrawable(d);
'130' can be changed (0-255) to acheive desired opacity.
Try below code
Dialog mDialog = new Dialog(mContext, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
try this:
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
For API 11+
Dialog mDialog = new Dialog(mContext, android.R.style.Theme_Holo_Light_Panel);