2013-07-11 2 views
0

사용자 정의 제목 표시 줄을 만드는 데 많은 자습서 중 하나를 사용하면 나머지 테마가 변경되는 것 같습니다.일반 제목을 사용하는 동안 사용자 정의 제목 표시 줄 사용

default theme

theme after custom titlebar

어떻게 확인 그래서 그것을 알아 냈다

//mainactivity.java 
    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); 
    setContentView(R.layout.activity_main); 
    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.customtitlebar); 

    //manifest. 
    <application 
    android:allowBackup="true" 
    android:icon="@drawable/ic_launcher" 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme"> 
    <activity 
     android:name="com.MediocreFireworks.cheapchug.MainActivity" 
     android:label="@string/app_name" 
     android:theme="@style/CustomTheme"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 


    //style.xml 
    <style name="CustomWindowTitleBackground"> 
    <item name="android:background">#323331</item> 
    </style> 

    <style name="CustomTheme" parent="android:Theme.Light"> 
    <item name="android:windowTitleSize">35dip</item> 
    <item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item> 
+0

괜찮습니까? 직접 제거하고 직접 만드시겠습니까? –

+0

제목 표시 줄을 제거한 다음 화면 상단에 레이아웃을 추가하여 제목 표시 줄로 사용한다는 의미입니까? – Thomas

+0

예. 또한 버튼을 추가 할 수 있습니다. 그게 네가 원하는지 모르겠다. –

답변

0

등이 메뉴 메뉴 예 테마의 나머지 부분을 변경 아웃과는 EditText 상자 제목 표시 줄을 변경할 수 있습니다 , 나는 android : Theme.Holo.Light를 사용해야했다. 그것은 최신 테마 다. 다른 api의 값 폴더에있는 다른 styles.xml을 사용하십시오

관련 문제