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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:18:48+00:00 2026-05-25T13:18:48+00:00

@Dan S, gave the below statement in this post -> display a still image

  • 0

@Dan S, gave the below statement in this post -> display a still image map

Then using a second ImageView (for the indicator) draw it on top and
move it to the correct place on the screen and make sure the
background in this View is transparent as well as the background of
your indicator

How can I create the second ImageView for my indicator? It should be transparent imageview as well as the indicator image.

UPDATE:
I am asking here on how to overlap my image map ImageView and transparent indicator ImageView in order to mark the current location.

  • 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-25T13:18:49+00:00Added an answer on May 25, 2026 at 1:18 pm

    An ImageView is transparent by default.
    Your indicator image resource should have a transparent background (e.g. transparent .PNG image).

    Just set the ImageView’s imageResource or backgroundResource to the PNG file.

    So your code for creating your ImageView will be something like this:

    ImageView myImageView = new ImageView(context);
    myImageView.setBackgroundColor(0x0); // not needed - it's the default
    myImageView.setImageResource(R.drawable.indicator_icon);
    

    but again, this’s the default and you still have to make sure your image’s background is transparent otherwise the ImageView’s background won’t matter.

    UPDATE: following @eros update of the question, here’s an updated answer:
    There are two options, i can think of, to achieve positioning of one imageview on top of the other:

    1. use the LayoutParams and set the margins to the position the indicator imageview
    2. draw the indicator imageview on top of the map bmp’s canvas

    personally i like the first option better because future changes won’t force you to repaint the indicator.

    here’s a class demonstrating option (1):

    public class MyMapView extends RelativeLayout {
        private ImageView mBackImageView;
        private ImageView mIndicatorImageView;
    
        public MyMapView(Context context) {
            super(context);
    
            mBackImageView = new ImageView(context);
            RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
                    LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
            mBackImageView.setImageResource(R.drawable.image1);
            mBackImageView.setScaleType(ImageView.ScaleType.FIT_XY);
            addView(mBackImageView, params);
    
            mIndicatorImageView = new ImageView(context);
            RelativeLayout.LayoutParams indParams = new RelativeLayout.LayoutParams(
                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
            mIndicatorImageView.setImageResource(R.drawable.image2);
            addView(mIndicatorImageView, indParams);
        }
    
        @Override
        protected void onLayout(boolean changed, int l, int t, int r, int b) {
            super.onLayout(changed, l, t, r, b);
            centerIndicatorPosition();
        }
    
        @Override
        protected void onSizeChanged(int w, int h, int oldw, int oldh) {
            super.onSizeChanged(w, h, oldw, oldh);
            centerIndicatorPosition();
        }
    
        // @eros: this's the part you want. this method just centers the indicator view
        // but if you have the relative position like you say, use it for the margins
        private void centerIndicatorPosition() {
            int xPos = (getMeasuredWidth() - mIndicatorImageView.getMeasuredWidth()) / 2;
            int yPos = (getMeasuredHeight() - mIndicatorImageView.getMeasuredHeight()) / 2;
            ((RelativeLayout.LayoutParams)mIndicatorImageView.getLayoutParams())
                .setMargins(xPos, yPos, 0, 0);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Reading things like this post on Dan Guzman's blog , I wonder: why isn't
i compiled myself apache2 and php5.2 using this guide http://dan.drydog.com/apache2php.html i tested php with
Would Dan Bernstein's hash function still function properly if I was using a 64
I'm using Jquery UI 1./Dan Wellman/Packt Publishing to learn JQuery UI. I'm working on
If I have data like this: Key Name 1 Dan 2 Tom 3 Jon
After, reading and understanding Dan Benjamin's post about installing Ruby, Rails, etc. on OSX
Given this data on SQL Server 2005: SectionID Name 1 Dan 2 Dan 4
I am connecting to a WCF service using the technique described by Dan Moyer
I created an app.config transform for my WinForms project using Dan Abramov's solution here
I'm using the jquery autocomplete 1.0.2 extension by Dylan Verheul, Dan G. Switzer, Anjesh

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.