Android 如何更改使用圆角时出现的操作栏后面的颜色?
我在定制Actionbar时遵循了这一点。我还在Android 如何更改使用圆角时出现的操作栏后面的颜色?,android,android-actionbar,Android,Android Actionbar,我在定制Actionbar时遵循了这一点。我还在操作栏上添加了圆角。问题是在圆角后面出现白色 这是我的活动main.xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="
操作栏上添加了圆角。问题是在圆角后面出现白色
这是我的活动main.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:orientation="vertical" >
</RelativeLayout>
My styles.xml
<style name="AppBaseTheme" parent="android:Theme">
<item name="android:windowBackground">@color/black</item>
</style>
<resources>
<style name="MyTheme" parent="Theme.AppCompat.Light">
<item name="android:colorBackground">@android:color/black</item>
</style>
</resources>
@颜色/黑色
这是我的actionbar_theme.xml:
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#ffc71e"
android:endColor="#d09e07"
android:type="linear"
android:angle="270"/>
<stroke
android:width="1px"
android:color="#333" >
</stroke>
<corners
android:topLeftRadius="7dp"
android:topRightRadius="7dp">
</corners>
</shape>
如何更改基本应用程序的背景。我想要黑色的
谢谢。我也有同样的问题,这个解决方案对我很有效。只需更改活动主题样式的颜色背景
@android:color/black
这是我在清单文件中的活动:
<activity
android:name=".MainActivity"
android:label="@string/title"
android:theme="@style/MyTheme"
android:parentActivityName=".MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
我的主题样式xml文件styles.xml
<style name="AppBaseTheme" parent="android:Theme">
<item name="android:windowBackground">@color/black</item>
</style>
<resources>
<style name="MyTheme" parent="Theme.AppCompat.Light">
<item name="android:colorBackground">@android:color/black</item>
</style>
</resources>
@android:彩色/黑色