2
我是Android新手,好像挂了一下...Android/Eclipse应用主题的麻烦
我正在尝试构建我的第一个Android应用程序。该应用程序大多只是Eclipse为您创建的模板...
我想使用Holo主题的基础和默认的黑色背景。我可以在Manifest中通过硬编码“@android:style/Theme.Holo”来使它工作(在模拟器上)。但是我无法将它从styles.xml中拉出来。
即使我做硬编码在清单中的Eclipse仍显示在活动编辑器,这使得与白色文本在白色背景上很难设计一个白色背景...
我敢肯定,这小东西我错过了。请参考下面...
在此先感谢 彼得
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ca.domain.test2"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:allowBackup="true"
android:icon="@drawable/icon48"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="ca.domain.test2.Something"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
和
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>
工作。我知道它在某处被覆盖。我正在考虑遗产的倒退。谢谢。 – PrecisionPete