3

我刚刚开始使用 Android 开发,完成了一些教程,现在我正在开发一个简单的应用程序。在模拟器和我的手机(Android 4.0.3 模拟器,Android 4.1.1 Atrix HD)上,我认为是 Holo Light 的应用程序都显示。我宁愿它是 Holo Dark,但是当我将以下行添加到 Android Manifest 文件中的应用程序块时:android:theme="@android:style/Theme.Holo"应用程序编译正常,但一打开它就强制关闭。

我究竟做错了什么?我敢肯定这很简单,但正如我所说,我对此很陌生。先谢谢大家了!

4

2 回答 2

1

The simplest thing you can do and you should always do is to read logs why does it crash. The log will tell you the reason of you crash. Please post the reason including logs from Logcat and only then ask about fixes:)

于 2012-12-27T10:18:43.537 回答
1

如果您想为应用程序的所有活动使用主题,那么您需要使用

<application android:theme="@style/CustomTheme">

AndroidManifest.xml中。如果您希望将主题应用于应用程序中的一个 Activity,则将android:theme属性添加到Activity标记中。所以需要知道您在应用程序中使用的类型。但是看看这些东西会更清楚你..
http://developer.android.com/guide/topics/ui/themes.html
http://www.androidengineer.com/2010/06/using-themes-in-android-applications.html

于 2012-12-27T07:45:28.873 回答