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 7785381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:14:48+00:00 2026-06-01T20:14:48+00:00

I am creating a small game for Android. At the moment I’m just creating

  • 0

I am creating a small game for Android. At the moment I’m just creating the UI for the menu screen.

As I’m doing a wooden theme, I also want to use a custom dialog for showing highscores etc so it follows the theme.

I have found some good guides, but I have this very strange problem with the background of the dialog. The dialog is almost transparent.

What I have done:
– created a dialog_theme.xml with:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Dialog" parent="android:Theme">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@color/transparent</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:backgroundDimEnabled">false</item>
  </style>
</resources>
  • created custom_dialog.xml with the elements I need (TextView for title and content, and button to close)
  • created a CustomDialog class which extends Dialog, and lets me build these custom dialogs rather easy with the content and title I want
  • using the CustomDialog in the activity to create the dialog

(the main guide I used for this blog.androgames.net/10/custom-android-dialog/ )

The problem is that the transparent background isn’t always transparent (showing the activity ui in the background). I have 4 custom buttons in this menu. Problem is that instead of just showing the dialog transparent and showing the whole ui in the background, then one of the images for a button is stretched and fills the whole dialog background. If I just use a standard background for this one button then the dialog background is transparent and shows the activity ui in the background as it should.

As I might have been bad at explaining I will show pictures of what I mean:
– Code for the button that causes the problem:

<Button
        android:id="@+id/id_about_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_below="@+id/id_achievements_button"
        android:layout_marginTop="15dp"
        android:background="@drawable/selector_about" />

Gives this result: (sorry but I can’t use pictures directly in the post yet)
http://dl.dropbox.com/u/2980431/wrong.png

Modifying the button code to:

<Button
        android:id="@+id/id_about_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_below="@+id/id_achievements_button"
        android:layout_marginTop="15dp"/>

Gives this result:
http://dl.dropbox.com/u/2980431/correct.png

Hope someone got an idea about why this is happening, and a solution to fix it – to be honest I am totally lost.

  • 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-06-01T20:14:49+00:00Added an answer on June 1, 2026 at 8:14 pm

    Still not sure what happened. In another project I came across the same thing – custom semi transparent dialog background, got another drawable added to the background. Renaming the wrong drawable showing in the background, and then clean the project fixed this for me.

    Strange.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

writing a small android game for a university assignment and just wanted to check
I am creating a small Yahtzee game and i have run into some regex
I'm creating a leader board (a small results table) for a Javascript game i've
I am creating a small project on ASP.NET. I want a simple drop down
I'm creating a small game and I have a peace of code that collects
I am creating a small game, the game is printed onto a panel on
So I am trying to learn SDL and creating a small game. When the
I am creating a small proprietary game server manager in Node.js; currently it runs
I'm creating a small game, you click buttons (up, down, left and right) to
I am new to programming. I am creating a small word jumble game to

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.