Notice
Recent Posts
Recent Comments
올해는 머신러닝이다.
Android: how to create transparent or opeque background 본문
Android/Tip&Tech
Android: how to create transparent or opeque background
행복한 수지아빠 2011. 12. 22. 14:12Android: how to create transparent or opeque background
출처 : http://zaman91.wordpress.com/2010/03/22/android-how-to-create-transparent-or-opeque-background/
You can implement application styles as you like in android platform. If you want to create a transparent background Activity then follow the steps below.
Transparency of background:
- create an activity
- set activity’s theme as “@android:style/Theme.Translucent” in AndroidManifest.xml
- that’s all
If it is needed to have a UI with semi-transparent background, and to define opacity then use this technique withTheme.Translucent. If you set the color of the UI layout as #29000000, the first hex 2-digit(#29) represents alpha channels of color and set opacity. If value is 00 that means 100% transparent. if value is set FF it will be opaque, it can be any value in 00 to FF.
Opaqueness of background / Opacity:
- create an activity
- set activity’s theme as “@android:style/Theme.Translucent” in AndroidManifest.xml
- declare opaque_back a color with setting alpha value such as #29000000(blackish), in …/res/colors.xml
- set activity’s layout background with this color in such as yourlayout.xml <LinearLayout
android:background=”@color/opaque_back”> … </…> - that’s all
Have a nice Android journey.
References:
- http://developer.android.com/guide/topics/ui/themes.html#Properties
- http://brainflush.wordpress.com/2009/03/15/understanding-android-themes-and-styles/
'Android > Tip&Tech' 카테고리의 다른 글
Looper Handler Thread [출처] Looper Handler Thread (1)|작성자 커트 (0) | 2011.12.26 |
---|---|
Multipart form-date 내용 (0) | 2011.12.26 |
Fragment animation 정의하기 팁#1 (0) | 2011.12.21 |
[펌]Sliding Toggle 버튼 만들기 (0) | 2011.12.15 |
java android 명명규칙 및 일반규칙 (0) | 2011.12.09 |