maxandonuts
maxandonuts

Reputation: 595

Android how to have transparent container with opaque elements

I'm using OSM Bonus Pack and osmdroid to develop a mapping app(recommended!), i've stumbled upon a problem when displaying the more_info windows.

I want to display an image, a title and a description and subdescription with the window background transparent.

The problem even though im defining the container(RelativeLayout) alpha to 0.8 and the elements alpha to 1.0, the containers are retaining the container transparency.

How do I keep the container with its alpha but keep the elements completely opaque?

Upvotes: 2

Views: 737

Answers (2)

MKer
MKer

Reputation: 3450

Why not just editing the bonuspack_bubble_black.9.png file with an image editor, and increase its transparency level? (taking care to respect the nine-patch borders, of course)

Upvotes: 1

Alex Salauyou
Alex Salauyou

Reputation: 14348

Remain alpha of your container 1.0, just set its background transparent.

NOT:

<RelativeLayout 
     android:alpha="0.8"
     android:background="#fff"
    ...

BUT:

<RelativeLayout 
     android:alpha="1.0"
     android:background="#afff"
    ...

Upvotes: 2

Related Questions