实际 Android 布局与设计师不同

Actual Android layout is different from designer

根据this post,我知道如何更改操作栏的颜色。所以我有以下 styles.xml 文件:

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
    </style>

    <style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
        <item name="android:background">#AFB42B</item>
    </style>

    <style name="MyTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:actionBarStyle">@style/MyActionBar</item>
    </style>
</resources>

这是布局文件:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingLeft="@dimen/activity_horizontal_margin"
                android:paddingRight="@dimen/activity_horizontal_margin"
                android:paddingTop="@dimen/activity_vertical_margin"
                android:paddingBottom="@dimen/activity_vertical_margin"
                tools:context=".MainActivity"
                android:orientation="vertical"
                android:background="#CDDC39"
              android:gravity="right">

    <EditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:inputType="numberDecimal"
        android:ems="10"
        android:id="@+id/text_field"
        android:hint="Enter Amount"
        android:textSize="15pt"
        android:autoText="false"
        android:background="#F0F4C3"
        android:padding="10dp"
        android:layout_margin="10dp"
        android:textColor="#212121"/>

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Convert it!"
        android:id="@+id/button"
        android:layout_margin="10dp"
        android:padding="25dp"
        android:textColor="#212121"/>

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/scrollView">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="Please Enter Amount"
            android:id="@+id/textView"
            android:textSize="10pt"
            android:typeface="monospace"
            android:textColor="#212121"/>
    </ScrollView>
</LinearLayout>

并且在设计器中,我选择了相应的主题,看起来不错。在设计器中,操作栏是绿色的,其他东西看起来也不错。但是,当我 运行 这个应用程序在我的 phone 上时,操作栏是黑色的,并且假设是绿色按钮(带有文本 "Convert it!" 的按钮)处于默认状态颜色。如果重要的话,我的 phone 使用 Android 4.3。

问:为什么实际布局和设计者不一样?那是因为 Android 版本吗?我该如何解决?

确保在清单文件

中指定 activity 的主题
<activity
   android:theme="@style/MyTheme">