0
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Titanium" parent="android:Theme.NoTitleBar.Fullscreen">
    <item name="android:windowBackground">@drawable/background</item>
</style>
</resources>

theme.xml を使用して ActionBar コンポーネントをカスタマイズするにはどうすればよいですか? 私はこれらのファイルを生成しようとしましたplatform/android/res folderが、うまくいきませんでした

http://jgilfelt.github.com/android-actionbarstylegenerator/#name=ActionBar&compat=holo&theme=light&actionbarstyle=solid&backColor=ffffff%2C100&secondaryColor=1f6e0d%2C100&tertiaryColor=F2F2F2%2C100&accentColor=fafffb%2C100

4

3 に答える 3

1

:を使用しています。代わりandroid:Theme.NoTitleBar.Fullscreenに使用しandroid:style/Theme.Holoて、throrin19 が提案するようにマニフェスト ファイルにテーマを設定してみてください。

于 2013-01-04T14:26:39.153 に答える
1

に配置した後、マニフェストにテーマを追加する必要があります<yourproject>/res/*

<!-- ... -->

<application
    android:name="app.package"
    android:icon="@drawable/icon"
    android:label="@string/app_name"
    android:theme="@style/Theme.Titanium">

<!-- ... -->
于 2013-01-04T14:17:48.563 に答える
1

そのようにしてください:

  <style name="CustomStyle" parent="@android:style/Theme.Holo.Light">
        <item name="android:actionBarStyle">@style/CustomActionBar</item>
  </style>

  <style name="CustomActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
        <item name="android:background">@drawable/ANY_DRAWABLE</item>
        <item name="android:displayOptions">useLogo|showHome</item>
        ...
        <item name="PARAM">VALUE</item>
  </style>

CustomActionBar スタイルでは、ActionBar パラメータを設定できます。アクティビティで CustomStyle を使用します。

更新: すべてのアプリケーションのマニフェストで CustomStyle を使用できます。早くやれよ :

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/CustomStyle">

または各アクティビティに使用します:

 <activity
     android:name="MainActivity"
     android:label="@string/app_name" 
     android:screenOrientation="portrait"
     android:theme="@style/CustomStyle">

幸運を!

于 2013-01-04T14:43:07.827 に答える