-1

I have a zone in my layout that I want to be transparent, while the rest of the layout has a black or an image in the background (kinda like a window effect). Is it possible in android?

Edit : Someone asked, so here is what Im trying to do :

enter image description here

The red part is supposed to be transparent, and there will be a movable widget in its place. The point is that when the widget move, what's behind the application appears.

Laetan
  • 879
  • 9
  • 26
  • Yes, just put a background image with a transparent part (it may be a 9 patch) – Phantômaxx Jul 29 '15 at 08:31
  • Feels a bit complicated. I need to put things over this backgrounds, in the transparent part and the black. Si I'd want the bacground to scale the same way the layout does. – Laetan Jul 29 '15 at 08:49
  • That's why you use a background, not a src. And that's where 9 patches come in very handy! – Phantômaxx Jul 29 '15 at 09:06
  • Seems to me that a background image scale with the pixel size of the scrren, when layout scale with the densisty pixel, which give different behaviour according to devices screen. The size difference between the background image and others part of the layout does not stay the same when I switch device in the Android studio design section. – Laetan Jul 29 '15 at 09:54
  • It seems to me that you didn't provide different resources, for different densities... – Phantômaxx Jul 29 '15 at 10:11

1 Answers1

0

Here is a link on how to create a transparent Activity. After creating a transparent activity, make sure that every other component that you add to the xml (except for the zone you want to leave transparent) are opaque. (i.e. have their backgrounds set).

Community
  • 1
  • 1
ihsan
  • 699
  • 2
  • 9
  • 26