2013-12-15 1 views
0

이것은 내 견과류를 몰아 내고 있으며 실제로는 매우 간단합니다.미리 작성된 테마를 Android 용으로 사용하는 경우

내 응용 프로그램에서 테마를 변경하는 방법을 알고 있습니다. 난 그냥 AndroidManifest.xml에이 라인을 변경할 필요가 있다고 생각 :

android:theme="@style/AppTheme" 

당신은 당신이 values/styles.xml에있는 어떤 주제에 AppTheme을 변경합니다.

하지만, 내 styles.xml 파일은 지루 :

<style name="AppBaseTheme" parent="android:Theme.Light"> 

</style> 
<style name="AppTheme" parent="AppBaseTheme"> 

</style> 

즉, 나는 테마가 있다고 생각하지 않습니까?

어디서 테마를 다운로드합니까? 무엇이 필요합니까? 아마도 styles.xml과 일부 애셋 (예 : 이미지)이 필요합니다. 저는 주로 백엔드 프로그래머이고 기본 테마보다 조금 더 재미있는 것을 원합니다.

감사합니다.

답변

1

내가 아는 안드로이드에 대한 미리 작성된 테마를 다운로드 할 수 없습니다. 인터넷의 일부 스 니펫을 사용하고 직접 styles.xml을 만들 수 있습니다.

<resources> 
    <!-- Base application theme is the default theme. --> 
    <style name="Theme" parent="android:Theme"> 
    </style> 

    <!-- Variation on our application theme that has a translucent 
background. --> 
    <style name="Theme.Translucent"> 
    <item name="android:windowBackground">@drawable/translucent_background</item> 
    <item name="android:windowNoTitle">true</item> 
    <item name="android:colorForeground">#fff</item> 
    </style> 

    <!-- Variation on our application theme that has a transparent 
background; this example completely removes the background, 
allowing the activity to decide how to composite. --> 
    <style name="Theme.Transparent"> 
    <item name="android:windowBackground">@drawable/transparent_background</item> 
    <item name="android:windowNoTitle">true</item> 
    <item name="android:colorForeground">#fff</item> 
    </style> 
    <style name="TextAppearance.Theme.PlainText" parent="android:TextAppearance.Theme"> 
    <item name="android:textStyle">normal</item> 
    </style> 

</resources> 

이 값 폴더에 styles.xml 파일에이 물건을 넣어 예를 들어 아래의 코드는 사용자 정의 테마입니다. 자신의 테마를 만들려면 colorForeground 등을 변경하십시오. 드로어 블 폴더에 이미지를 추가하고 여기를 참조하십시오.

관련 문제