How to make layout's and view's background transparent?

I'm trying to make a layout with a background and add a scroll view at the bottom of this layout.

here's my code:

FrameLayout mainLayout = new FrameLayout(getApplicationContext());
mainLayout.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));

FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, 200);
params.gravity = Gravity.BOTTOM|Gravity.CENTER;

final ScrollView scrollView = new ScrollView(getApplicationContext());

StorageView storageView = new StorageView(getApplicationContext());
storageView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));

Drawable drawable = getResources().getDrawable(R.drawable.background1);




why I see only the background image?


If I remove all the setBackgroundColor and move the setBackgroundDrawable to the ScrollLayout or the StorageView I see the background on the whole screen


I edit the code: I remove the unnecessary layouts, and set a background drawable with alpha set to 0, and now it works.

well, I'll be happy if someone explain to me why I need to do this?


Try this one:


<?xml version="1.0" encoding="utf-8"?>
  <style name="Theme.Transparent" parent="android:Theme">
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:backgroundDimEnabled">false</item>

and then in the manifest

<activity android:name=".SampleActivity" android:theme="@style/Theme.Transparent">

Add the following attribute


Need Your Help

Apple Segmenter - is it working right?

iphone video streaming

I'm trying to get our video files (m4v) converted to the Apple http streaming and ran into some questions.

Is there a future for PowerPoint VBA/VSTO?

vba vsto powerpoint powerpoint-vba

Does anyone know what the future holds for VBA/VSTO programming in PowerPoint? I've been working on a Office automation project and find it frustrating to work with PowerPoint in particular since...