Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6681325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:34:38+00:00 2026-05-26T04:34:38+00:00

I struggling with how to create my own custom dialog. I follow this example

  • 0

I struggling with how to create my own custom dialog.

I follow this example.

1)one feature I need is to disable the “window” background – currently when I show a dialog there’s like a black background with some transparency. how do I make it without this “window” background or completely transparent?

2) How do I set the size of the dialog?

3) I want to add an image to the background of the dialog – how do I make it transparent ?

edit*

<style name="Dialog" parent="android:style/Theme.Dialog">
    <item name="android:windowBackground">@color/transparent</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowIsFloating">false</item>
</style>

I used this style for my Dialog and add the background using frameLayout, like this:

 final CustomDialog dialog = new CustomDialog(context, R.style.Dialog);
 ImageView image = new ImageView(context);
 image.setImageResource(R.drawable.background2);
 image.setAlpha(75);
 image.setVisibility(View.VISIBLE);

 final FrameLayout frameLayout = new FrameLayout(context);
 frameLayout.setPadding(40, 100, 40, 100);
 frameLayout.addView(image, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT) );

 View layout = inflater.inflate(R.layout.dialog, null);
 frameLayout.addView(layout, new LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
 dialog.setContentView(frameLayout);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:34:38+00:00Added an answer on May 26, 2026 at 4:34 am
    1. You should be able to set the dialog completely transparent with:
      Dialog myDialog = new Dialog(this,android.R.style.Theme_Translucent_NoTitleBar);
    2. If you customize a layout for your dialog, you should be able to set the height & width attributes.
    3. Set an ImageView as your background and then adjust the transparency with
      myImage.setAlpha(127);
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm struggling to create a custom UITableViewCell (in IB) that has a UIImageView on
I'm struggling to create a custom build for a Range Slider. My slider works
I've been struggling with a feature I've been trying to create for sometime. The
I'm struggling since a few hours with this design question. In Cocoa for example,
I'm struggling to create a WebView with transparent background. webView.setBackgroundColor(0x00FFFFFF); webView.setBackgroundDrawable(myDrawable); Then I load
I'm really struggling to create a valid multidimensional JavaScript array with the following basic
I'm struggling to create a little Blackjack console game in C++. I've written almost
I'm trying (or rather struggling) to create a little Blackjack game. After some JavaScript
I'm using mysql to create an hotel booking system, but i am struggling a
I'm using XCode 4.2, and I'm struggling with how to create a Single or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.