I would like LinearLayout to be translucent (I don't mean transparency). I want to imitate the dialogue in my work. So I tried this:
In the manifest:
android:theme="@android:style/Theme.Translucent"
In Activity onCreate:
LinearLayout MyLayout = (LinearLayout)findViewById(R.id.MyLayout);
MyLayout.setBackgroundColor(Color.BLACK);
MyLayout.getBackground().setAlpha(50);
But this does not work, because I do not see the Home desktop at all. Any idea?
I also tried this in xml, but it doesn't work either:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/MyLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#22FFFFFF"
android:orientation="vertical" >
</LinearLayout>
source
share