Android颜色不工作
我的android项目Android颜色不工作,android,themes,Android,Themes,我的android项目 AndoidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.myfirstapp" android:versionCode="1" android:versionName="1.0" >
AndoidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:debuggable="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/CustomActionBarTheme" >
<activity
android:name="com.example.myfirstapp.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.example.myfirstapp.DisplayMessageActivity"
android:label="@string/title_activity_display_message"
android:parentActivityName="com.example.myfirstapp.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.myfirstapp.MainActivity" />
</activity>
</application>
</manifest>
但这种颜色似乎并没有反映在android应用程序中。仍然用黑色显示所有内容 这可能是因为您似乎缺少颜色的alpha部分,而不是将颜色设置为
<item name="android:background">#ffccff</item>
#ffccff
实际上,您应该通过如下所示的方式将Alpha添加到Full:
<item name="android:background">#ffffccff</item>
#ffffccff
请注意,在RGB十六进制数之前添加了FF
希望这有帮助
关于您是否检查了“MyActionBar”是否设置为透明,并且父对象是否为黑色?另外,请提供更多关于您正在尝试做什么的信息。35;FFFFCCFF做这项工作它做得很好@hitech,您能否将此作为回答,我也会接受
<item name="android:background">#ffffccff</item>