1

我想为我所有活动的背景设置白色。仍然没有找到简单的方法,它会将我的文本颜色更改为黑色。我在我的一些活动中使用了 sherloack bar,我认为这是我的问题。我的清单看起来像这样:

<application
        android:icon="@drawable/rss"
        android:label="@string/app_name"
        android:theme="@style/CustomTheme"
         >
        <activity
            android:name=".ListRss"
            android:label="@string/title_activity_listr_rss"
            android:theme="@style/Theme.Sherlock" >
        </activity>
        <activity android:name="RssItem" >
        </activity>
        <activity android:name="editRss.AddNewRss">
        </activity>
        <activity android:name="openRssItem.WebActivity" >

我的风格在哪里

   <style name="CustomWindowTitleBackground">
        <item name="android:background">#FFFFFF</item>
    </style>

    <style name="CustomTheme" parent="android:Theme">
         <item name="android:background">#FFFFFF</item>
        <item name="android:windowTitleSize">35dip</item>
        <item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
    </style>

例如我的活动

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/BackgroundColor"
android:id="@+id/myScreen">
<LinearLayout 
    android:id="@+id/linearLa"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"

    >

    <ImageView
        android:id="@+id/image"
        android:layout_width="50dip"
        android:layout_height="50dip"
        android:scaleType="centerCrop"
        android:src="@drawable/rss" />

很高兴收到一个简单的解决方案,将背景颜色解决为白色,将文本解决为黑色。

4

1 回答 1

1

如果您想使用 ActionBarSherlock,则不能android:Theme用作主题的父主题(除非您想覆盖所有内容......)。如果你想拥有浅色主题,你必须使用这个:

<style name="CustomTheme" parent="Theme.Sherlock.Light">
[...]
</style>
于 2012-12-29T17:52:29.913 回答