Theme_HoloEverywhereLight_Sherlock显示深色背景 [英] Theme_HoloEverywhereLight_Sherlock showing dark background

查看:338
本文介绍了Theme_HoloEverywhereLight_Sherlock显示深色背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用与的 HoloEverywhere 库:// actionbarsherlock.com/相对=nofollow> ActionBarSherlock 上显示姜饼手机的ICS寻找应用程序。该Theme.HoloEverywhereDark.Sherlock主题的伟大工程。但是,当我试图改变主题,以Theme.HoloEverywhereLight.Sherlock,所有文本变为深色文本,但活动的背景留黑了。

I'm using Christophe Versiuex's HoloEverywhere library in concert with ActionBarSherlock to display an ICS looking app on Gingerbread phones. The Theme.HoloEverywhereDark.Sherlock theme works great. But when I try to change the theme to Theme.HoloEverywhereLight.Sherlock, all the text changes to dark text, but the Activity backgrounds stay dark.

我做的是:

  setTheme(R.style.Theme_HoloEverywhereLight_Sherlock);
  setContentView(R.layout.mylayout);

在Activity.onCreate()方法。

in the Activity.onCreate() method.

在看code,它定义了:

In looking at the code, it defines:

<style name="Theme.HoloEverywhereLight.Sherlock" parent="Theme.Sherlock.Light">
    <item name="android:windowBackground">@drawable/background_holo_light</item>
    .
    .
    .

所以它看起来像它应该工作。

so it looks like it should work.

有没有其他人使用的光的主题,并得到一个浅色背景?

Has anyone else used the Light theme and gotten a light background?

感谢名单。

推荐答案

我想通了这一点。我做的:

I figured this out. I was doing:

super.onCreate(savedInstanceState);
setTheme(R.style.Theme_HoloEverywhereLight_Sherlock);
setContentView(R.layout.mylayout);

当我应该做的事情:

setTheme(R.style.Theme_HoloEverywhereLight_Sherlock);
super.onCreate(savedInstanceState);
setContentView(R.layout.mylayout);

setTheme()需要super.onCreate之前被称为()。现在光题材的作品就像一个魅力。

setTheme() needed to be called before super.onCreate(). Now the light theme works like a charm.

这篇关于Theme_HoloEverywhereLight_Sherlock显示深色背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆