2013년 10월 2일 수요일

Transparent Activity (투명 배경의 activity) 만들기

이전 블로그에서 이전 함 (원본 글 2013/10/02 작성)

투명한 배경의 Activity 만들기



up vote10down voteaccepted
You could apply a transparent theme to the required activity. Create a new style in /res/values/style.xml
<resources>
<style name="Transparent">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
<item name ="android:windowBackground">@color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:colorForeground">#fff</item>
</style>
</resources>
The value of transparent is
<color name="transparent">#00000000</color>
Now in AndroidManifest.xml declare the theme of the activity to the one you just created.
<activity android:name="MyActivity" android:theme="@style/Transparent"></activity>
share|improve this answer


* 50% 의 불투명 배경을 만들기 위해서는 color를 #7F000000 으로 설정..

: 이건 출력해 놓고 보면 귀찮지 않을듯....


Below code for black:-
<color name="black">#000000</color>
Now if i want to use opacity than you can use below code :-
 <color name="black">#99000000</color> 
and below for opacity code:-
Hex Opacity Values
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
60% — 99
55% — 8C
50% — 80
45% — 73
40% — 66
35% — 59
30% — 4D
25% — 40
20% — 33
15% — 26
10% — 1A
5% — 0D
0% — 00
share|improve this answer

댓글 없음:

댓글 쓰기