페이지

2011년 5월 27일 금요일

Theme.Wallpaper - 배경화면을 백그라운드로

배경화면을 백그라운드로 설정하는 예제

AndroidManifest.xml 에서 테마로 Wallpaper가 설정 되어 있다.
        <activity android:name=".app.WallpaperActivity"
                android:label="@string/activity_wallpaper"
                android:theme="@style/Theme.Wallpaper">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.SAMPLE_CODE" />
            </intent-filter>
        </activity>

Styles.xml에 Theme.Wallpaper 가 정의 되어 있으며 부모로 android:style/Theme.Wallpaper을 설정했다. -> 배경화면 설정 
    <style name="Theme.Wallpaper" parent="android:style/Theme.Wallpaper">
        <item name="android:colorForeground">#fff</item>
    </style>

WallpaperActivity Class와 매치되는 XML은 translucent_background.xml (WallpaperActivity.java)
        setContentView(R.layout.translucent_background);

댓글 없음:

댓글 쓰기