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

  • Home
  • SEARCH
  • 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 239529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:35:33+00:00 2026-05-11T20:35:33+00:00

Is it possible to have overlapping views in Android? I would like to have

  • 0

Is it possible to have overlapping views in Android? I would like to have an ImageView with a transparent png in the front and another view in the background.

edit:

This is what I have at the moment, the problem is that the image in the imageView is not transparent, the parts that should be transparent are just black.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/gallerylayout"
>
<Gallery android:id="@+id/overview"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    />

 <ImageView android:id="@+id/navigmaske"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:src="@drawable/navigmask"
    /> 

</RelativeLayout>

edit:

I got it to work, it was a theme file from another programmer on the team.
Just changed this

<item name="android:background">#FF000000</item>

to this

<item name="android:background">#00000000</item>
  • 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-11T20:35:34+00:00Added an answer on May 11, 2026 at 8:35 pm

    Android handles transparency across views and drawables (including PNG images) natively, so the scenario you describe (a partially transparent ImageView in front of a Gallery) is certainly possible.

    If you’re having problems it may be related to either the layout or your image. I’ve replicated the layout you describe and successfully achieved the effect you’re after. Here’s the exact layout I used.

    <RelativeLayout 
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/gallerylayout"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent">
      <Gallery
        android:id="@+id/overview"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
      />
      <ImageView
        android:id="@+id/navigmaske"
        android:background="#0000"      
        android:src="@drawable/navigmask"
        android:scaleType="fitXY"
        android:layout_alignTop="@id/overview"
        android:layout_alignBottom="@id/overview"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
      />
    </RelativeLayout>
    

    Note that I’ve changed the parent RelativeLayout to a height and width of fill_parent as is generally what you want for a main Activity. Then I’ve aligned the top and bottom of the ImageView to the top and bottom of the Gallery to ensure it’s centered in front of it.

    I’ve also explicitly set the background of the ImageView to be transparent.

    As for the image drawable itself, if you put the PNG file somewhere for me to look at I can use it in my project and see if it’s responsible.

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

Sidebar

Related Questions

Is it possible to draw overlapping semi-transparent (with a low alpha value) which will
I have a scenario where it's possible to earn > 1 achievement at the
I have a table that simplified looks like this: create table Test ( ValidFrom
My view is that a C implementation cannot satisfy the specification of certain stdio
I have two sets of scattered data x y z and x2 y2 z2
I want to find the longest possible sequence of words that match the following
I'm new to Lua. Say i have a string 1234567890. I want to iterate
I am working on a CMS template and try to find out if this
For my web app i need to handle access requests. Requests are entered for
I previously posted this question as jquery/javascript: arrays - jquery/javascript: arrays . But since

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.