Skip to content Skip to sidebar Skip to footer

Customized Spinner Dialog With Unwanted Space

I'm creating a custom Dialog that is started by a custom spinner. What I was trying to do is customize the dialog the spinner calls. However, there is an annoying space in the dial

Solution 1:

diaPhoto = new Dialog(this, android.R.style.Theme_Translucent_NoTitleBar);

Solution 2:

I solved it following the documentation

And based in this code as advised by the documentation link above:

AlertDialog.Builder builder;
AlertDialog alertDialog;

ContextmContext= getApplicationContext();
LayoutInflaterinflater= (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
Viewlayout= inflater.inflate(R.layout.custom_dialog,
                               (ViewGroup) findViewById(R.id.layout_root));

TextViewtext= (TextView) layout.findViewById(R.id.text);
text.setText("Hello, this is a custom dialog!");
ImageViewimage= (ImageView) layout.findViewById(R.id.image);
image.setImageResource(R.drawable.android);

builder = newAlertDialog.Builder(mContext);
builder.setView(layout);
alertDialog = builder.create();

Post a Comment for "Customized Spinner Dialog With Unwanted Space"