你好我试过@ style / theme和@android:style / theme但是没有用......我的代码是...... 的manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ucapp.uppercrustapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/themes" >
<activity
android:name="com.ucapp.uppercrustapp.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="com.ucapp.uppercrustapp.UserRegister"
android:label="@string/title_activity_user_register" >
</activity>
<activity
android:name="com.ucapp.uppercrustapp.ForgotPassword"
android:label="@string/title_activity_forgot_password" >
</activity>
<activity
android:name="com.ucapp.uppercrustapp.SendEmailTransition"
android:label="@string/title_activity_send_email_transition" >
</activity>
<activity
android:name="com.ucapp.uppercrustapp.OrderMenu"
android:label="@string/title_activity_order_menu" >
</activity>
</application>
</manifest>
自定义theme.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Generated with http://android-holo-colors.com -->
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="green" parent="@style/_green"/>
<style name="_green" parent="Theme.AppCompat.Light">
<item name="android:editTextStyle">@style/EditTextgreen</item>
<item name="android:checkboxStyle">@style/CheckBoxgreen</item>
<item name="android:spinnerStyle">@style/Spinnergreen</item>
<item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItemgreen</item>
<item name="android:progressBarStyleHorizontal">@style/ProgressBargreen</item>
<item name="android:listViewStyle">@style/ListViewgreen</item>
<item name="android:listViewWhiteStyle">@style/ListViewgreen.White</item>
<item name="android:spinnerItemStyle">@style/SpinnerItemgreen</item>
colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="green_color">#1c810b</color>
</resources>
styles.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Generated with http://android-holo-colors.com -->
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="EditTextgreen" parent="android:Widget.EditText">
<item name="android:background">@drawable/green_edit_text_holo_light</item>
<item name="android:textColor">#000000</item>
</style>
<style name="CheckBoxgreen" parent="android:Widget.CompoundButton.CheckBox">
<item name="android:button">@drawable/green_btn_check_holo_light</item>
</style>
<style name="Spinnergreen" parent="android:Widget.Spinner">
<item name="android:background">@drawable/green_spinner_background_holo_light</item>
<item name="android:dropDownSelector">@drawable/green_list_selector_holo_light</item>
</style>
<style name="SpinnerDropDownItemgreen" parent="android:Widget.DropDownItem.Spinner">
<item name="android:checkMark">@drawable/green_btn_radio_holo_light</item>
</style>
<style name="ProgressBargreen" parent="android:Widget.ProgressBar.Horizontal">
<item name="android:progressDrawable">@drawable/green_progress_horizontal_holo_light</item>
<item name="android:indeterminateDrawable">@drawable/green_progress_indeterminate_horizontal_holo_light</item>
<item name="android:minHeight">16dip</item>
<item name="android:maxHeight">16dip</item>
</style>
<style name="ListViewgreen" parent="android:Widget.ListView">
<item name="android:listSelector">@drawable/green_list_selector_holo_light</item>
</style>
<style name="ListViewgreen.White" parent="android:Widget.ListView.White">
<item name="android:listSelector">@drawable/green_list_selector_holo_light</item>
</style>
<style name="SpinnerItemgreen"
parent="android:TextAppearance.Widget.TextView.SpinnerItem">
<item name="android:textColor">#000000</item>
</style>
</resources>
此自定义颜色主题是由在线生成器制作的。我曾试图在youtube上看,但没有运气。我试过但是文件夹中的图像会改变它们,但我想知道如何制作自定义主题
答案 0 :(得分:2)
你的清单中应该是android:theme="@style/green"
。