Android操作栏主题 @可绘制/背景

Android操作栏主题 @可绘制/背景,android,titanium-mobile,Android,Titanium Mobile,如何使用theme.xml自定义ActionBar组件。我试图生成这些文件,并将它们放在我的平台/android/res文件夹中,但没有成功 在/res/*中放置后,您应该在清单中添加主题: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="Theme.Titanium" parent="android:Theme.NoTitleBar.Fullscreen"> <it

如何使用theme.xml自定义ActionBar组件。我试图生成这些文件,并将它们放在我的
平台/android/res文件夹中,但没有成功


/res/*
中放置后,您应该在清单中添加主题:

<?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>

/res/*
中放置后,应在清单中添加主题:

<?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>

您使用的是:
android:Theme.NoTitleBar.Fullscreen
,尝试改用
android:style/Theme.Holo
,并按照throrin19的建议在清单文件中设置主题。

您使用的是:
android:Theme.NoTitleBar.Fullscreen
,尝试改用android:style/Theme.Holo,并按照throrin19的建议在清单文件中设置主题。

这样做:

<!-- ... -->

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

<!-- ... -->

@样式/自定义操作栏
@可提取/任何可提取
useLogo | showHome
...
价值
在CustomActionBar样式中,可以设置ActionBar参数。在您的活动中使用自定义样式

更新:您可以在清单中为所有应用程序使用CustomStyle。就这么做吧:

  <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>

或用于每项活动:

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

祝你好运

这样做:

<!-- ... -->

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

<!-- ... -->

@样式/自定义操作栏
@可提取/任何可提取
useLogo | showHome
...
价值
在CustomActionBar样式中,可以设置ActionBar参数。在您的活动中使用自定义样式

更新:您可以在清单中为所有应用程序使用CustomStyle。就这么做吧:

  <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>

或用于每项活动:

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


祝你好运

您使用的是哪个android平台?您使用的是android默认ActionBar还是ActionBar Sherlock?我使用的是android默认ActionBar。您是否按照下面的回答在清单文件中添加了样式?您使用的是哪个android平台?您使用的是android默认ActionBar还是ActionBarSherlock?我使用的是android默认操作栏。你是否按照下面的回答在清单文件中添加了样式?如何在清单中使用此自定义样式。xmlandroid:theme=“@style/CustomStyle”你试过了吗?@Ilya Demidov请看这篇文章,请就此建议我如何在清单中使用此自定义样式。xmlandroid:theme=“@style/CustomStyle”你试过了吗?@Ilya Demidov请看这篇文章,请在这篇文章中推荐我