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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:51:46+00:00 2026-05-24T23:51:46+00:00

I try to implement the Map View balloon for GoogleMaps, but I block with

  • 0

I try to implement the Map View balloon for GoogleMaps, but I block with the layout of the balloon.
The size of the balloon must be the content size, however, it takes the background drawable size, because it’s bigger. As I have a quite large balloon 9-patch image, provided by someone else, a small balloon content takes all the screen (drawable size).

I saw this related question: How to wrap content views rather than background drawable? , which is exactly what I want, but it has no correct answer (using a FrameLayout makes the same problem, because the ImageView src will take the drawable size too, with wrap_content or fill_parent).

Here is my layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content" android:id="@+id/balloon_main_layout"
    android:orientation="horizontal" android:clickable="true"
    android:focusable="true" android:focusableInTouchMode="true"
    android:layout_width="wrap_content" android:background="@drawable/info_bulle_selector">
    <LinearLayout android:id="@+id/linearLayout1"
        android:layout_height="wrap_content" android:layout_width="0dp"
        android:layout_weight="1">
        <TextView android:layout_height="wrap_content"
            android:layout_width="wrap_content" android:text="TextView"
            android:id="@+id/balloon_item_title" android:textColor="#ffffff"></TextView>
    </LinearLayout>
    <ImageView android:id="@+id/balloon_close"
        android:layout_marginLeft="5dp" android:src="@drawable/fermer_selector"
        android:scaleType="fitXY" android:layout_height="30dp"
        android:layout_width="30dp"></ImageView>
</LinearLayout>

Here is a screen of what I have (the red space has to be deleted):
Current baloon layout

If you have any idea to solve this problem (which I often have when I design my layouts with background image), it would be great.
Thanks in advance.

EDIT:
Here the nine-patch png:
nine-patch balloon

  • 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-24T23:51:47+00:00Added an answer on May 24, 2026 at 11:51 pm

    When I do understand your problem right, you have two options:

    1) make the balloon 9-patch image smaller, especially the non-stretchable and the padding areas of the 9-patch image, so it can better fit to smaller content. See for more documentation here: http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch

    EDIT:

    As I notice in point 1), your 9-patch image was too big. It has a dimension of 330px in width and 74px in height. Because your content does not fill up the whole background images width and height, you got spaces within your layout.

    As a possible solution, please shrink your 9-patch image. I shrinked your image to a width of 150px and a height of 34px and I got the following result:

    screen shows 3 balloons with different contents

    Here is the shrinked 9-patch image:
    enter image description here

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

Sidebar

Related Questions

If I try to implement this simple-as-possible example: Update Content with AJAXRefreshRequest it does
I had try to implement the send me log feature into my apps but
I try to implement Hash join in Hadoop. However, Hadoop seems to have already
I've tried to implement the Google Map View tutorial on the Android developer site,
If I try to implement my class on this file I get an error
I've try to implement integration tests for a working application (spring, hibernate, soap, cxf).
I would like to implement an B+ tree in Java and try to optimize
My first try of MVC. Am trying to implement a simple example. Inspiration from
A Couple of years back due to a improperly implemented Try Catch Finally block
Thought I'd try to implement SHA1 in Haskell myself. I came up with an

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.