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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:50:42+00:00 2026-06-10T00:50:42+00:00

Sorry if my topic is confusing, I am not sure which words should i

  • 0

Sorry if my topic is confusing, I am not sure which words should i use to describe the layout I need.

Currently, I am working on a project that needs to overlay a hollow layout on map view, which the hollow layout will use to display the far distance location point, I post an image to demonstrate what I mean.

Mapview with stroke overlay

Basically the whole screen is fill by Mapview, and the overlay layout should overlay it without cover the center, like what I show in the image.

Here is the xml show what I have done to make layout like above

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<com.google.android.maps.MapView
android:id="@+id/MapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="..."
/>

   <View
   android:layout_width="320dip"
   android:layout_height="50dip"
   android:layout_gravity="center_horizontal|top"
   android:background="#800ff4ff"
   android:textColor="#ffffffff" />


 <View
    android:layout_width="320dip"
    android:layout_height="50dip"
    android:layout_gravity="center_horizontal|bottom"
    android:background="#800ff4ff"
    android:textColor="#ffffffff"
  />

<View
    android:layout_width="50dip"
    android:layout_height="520dip"
    android:layout_gravity="center_vertical|right"
    android:background="#800ff4ff"
    android:textColor="#ffffffff" />

 <View
    android:layout_width="50dip"
    android:layout_height="520dip"
    android:layout_gravity="center_vertical|left"
    android:padding="20dip"
    android:background="#800ff4ff"
    android:textColor="#ffffffff" />

</FrameLayout>

I use frame layout to allow layout can overlay others, and create 4 separate on each edge to simulate what I really want (empty in the center). I just not sure who to make layout only show 4 sides and keep the center invisible, if anyone can help please give me some guidance. thanks.

  • 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-10T00:50:44+00:00Added an answer on June 10, 2026 at 12:50 am

    There is another easy option that you can use which meets your requirements.

    • Create new drawable resource with defined shape. Call this resource (XML file): margin_border.xml and place it under drawable folder.
      The content of this XML:

      <?xml version="1.0" encoding="utf-8"?>
      <shape xmlns:android="http://schemas.android.com/apk/res/android"
          android:shape="rectangle" >
      
          <stroke
              android:width="50dp"
              android:color="#800ff4ff" />
      
          <solid android:color="#00000000" />
      
      </shape> 
      

      Explanation:
      This shape will act as border/frame for your inner layout. The ‘stroke’ attribute which is a border could be in any color you want and the ‘solid’ attribute has transparent color.

    • Then use this shape in your main layout:

      <?xml version="1.0" encoding="utf-8"?>
      <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" >
      
          <com.google.android.maps.MapView
              android:id="@+id/MapView"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:layout_alignParentBottom="true"
              android:layout_alignParentLeft="true"
              android:layout_alignParentRight="true"
              android:layout_alignParentTop="true"
              android:apiKey="..."
              android:clickable="true"
              android:enabled="true" />
      
          <!-- Set hollow layout -->
          <LinearLayout
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:layout_alignParentBottom="true"
              android:layout_alignParentLeft="true"
              android:layout_alignParentRight="true"
              android:layout_alignParentTop="true"
              android:background="@drawable/margin_border"
              android:padding="50dp" >
          </LinearLayout>
      
      </RelativeLayout>
      

      Explanation:
      The main layout is RelativeLayout. The MapView didn’t change, except alignParent flag for all directions which is set to true like it’s shown here.

      And finally use any layout you want for the center. I used LinearLayout while background is referencing to shape drawable.

      Note: The padding of this layout must be the same as the stroke width in the shape. In this case it is 50dp

    This is how it looks on my mobile (screenshot):

    enter image description here

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

Sidebar

Related Questions

Sorry to follow this topic http://stackoverflow.com/questions/11044825/javascript-run-on-ie-7 I want to use document.GetElementByClassName ON INTERNET EXPLORE
sorry for that question, but i've searched about that topic, and it's not really
I wasn't sure how to word the question for this topic...sorry. I'm just starting
sorry for poor topic name, i could not think for any thing better ;)
Sorry I had no idea how set a topic which could express what help
Sorry, this is quite a special topic so this may not be of interest
Sorry for confusing the topic, this was the original question: How to reallocate an
Sorry for creating another topic because my question wasn't specific and not accurate to
Sorry for bumpy topic name (feel free to edit if you find more fitting
I'm new to this topic so sorry if this is a stupid question :\

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.