-2

这太奇怪了。

最好的方法是给你看一张图片:

在此处输入图像描述

我没有设置任何主题或类似的东西,所以应该使用默认的...

任何的想法?

编辑:这是同一个设备!安卓 4.2 模拟器。

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="es.triiui.myapp.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="es.triiui.myapp.Activity_EditDetails"
        android:label="@string/title_activity_activity__edit_details" >
    </activity>
    <activity
        android:name="es.triiui.myapp.AddNewEntry"
        android:label="@string/title_activity_add_new_entry" >
    </activity>
    <activity
        android:name="es.triiui.myapp.ShowDetails"
        android:label="@string/title_activity_show_details" >
    </activity>
    <activity
        android:name="es.triiui.myapp.Setpassword"
        android:label="@string/title_activity_setpassword" >
    </activity>
</application>

(values/styles.xml) 是:

<resources>
<style name="AppBaseTheme" parent="android:Theme.Light">
</style>

<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>

(values-ca/styles.xml) 是:

<resources>
<style name="AppBaseTheme" parent="android:Theme.Light">
</style>
<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

</resources>

两者完全相同。

任何的想法?

4

2 回答 2

1

我没有设置任何主题或类似的东西,所以应该使用默认的...

从以下文档android:theme

<application>如果未设置此属性,则活动从元素的主题属性继承整个应用程序的主题集。如果该属性也未设置,则使用默认系统主题

因此,由于您没有指定主题,它将使用 devicedefault 主题,因此左侧设备使用 holo 主题,右侧设备使用 pre HC 主题。

于 2013-04-09T13:24:18.617 回答
1

您发布的那些 XML 资源是错误的。

通常,主题会进入themes.xml(但这不重要,因为它们只是一种样式),但更重要的是,您没有结束</resources>标记(复制/粘贴错误?),也没有命名空间定义(xlmns属性 on <resources>)。

这两个都应该触发 AAPT 错误(肯定是缺少关闭标记,命名空间,我不确定 - 它肯定会触发 Android Lint 错误!)。

尝试删除values-ca/styles.xml文件。它将默认为values/styles.xml,您不应该看到任何视觉变化。

于 2013-04-09T21:14:06.177 回答