Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a semi-transparent instruction page in Android?

Tags:

android

I am new to Android and trying to work on this problem for last 2 days but could find a solution. Any help will be highly appreciated. How to create a semi-transparent page for instruction as used by an App Calorie Counter in Android Market?

Instruction page in Android

like image 769
Gaurav Agarwal Avatar asked Jan 12 '12 19:01

Gaurav Agarwal


People also ask

What is translucent in Android?

android:windowIsTranslucent indicates weather the window in which the activity is present in translucent state or not. It must be a boolean value i.e. it can be true or false. android:windowBackground is used to set the background of the main window.

How do you change the color of the opacity on an android?

setAlpha(51); Here you can set the opacity between 0 (fully transparent) to 255 (completely opaque). The 51 is exactly the 20% you want.


1 Answers

Create a new activity and set the top-level view to have a translucent background:

android:background="#c0000000" 

EDIT: You also need to declare the activity to have a transparent background. Setting this theme for the activity in the manifest will work:

android:theme="@android:style/Theme.Translucent" 
like image 132
Ted Hopp Avatar answered Oct 18 '22 02:10

Ted Hopp