第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

使用AppCompat更改操作欄的背景顏色

使用AppCompat更改操作欄的背景顏色

呼啦一陣風(fēng) 2019-12-03 10:02:30
我在網(wǎng)上發(fā)現(xiàn)了有關(guān)此問題的一些問題。不幸的是,到目前為止,我嘗試的所有操作均未成功。標(biāo)題說,我需要更改操作欄的背景顏色。該項(xiàng)目的最小sdk為9,最大sdk為19。我在res / values文件夾中創(chuàng)建了一個(gè)xml文件:red_actionbar.xml<?xml version="1.0" encoding="utf-8"?><resources>    <style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light">        <item name="actionBarStyle">@style/MyActionBar</item>    </style>    <style name="MyActionBar"           parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">        <item name="background">@color/red</item>    </style></resources>存儲(chǔ)在res / values中的colors.xml<resources>    <color name="red">#FF0000</color></resources>和清單中我更改主題的部分<application    android:allowBackup="true"    android:icon="@drawable/ic_launcher"    android:label="@string/app_name"    android:theme="@style/CustomActionBarTheme" >但是什么都沒有改變。問題出在哪里?該應(yīng)用程序接受該代碼,因?yàn)槿绻腋囊韵聝?nèi)容:<style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light">至<style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar ">它確實(shí)改變了我的應(yīng)用程序的主題,所以問題出在風(fēng)格上,但我不知道如何解決。<?xml version="1.0" encoding="utf-8"?><resources>    <style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light">        <item name="android:actionBarStyle" tools:ignore="NewApi">@style/MyActionBar</item>        <item name="actionBarStyle">@style/MyActionBar</item>    </style>    <style name="MyActionBar"           parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">        <item name="android:background"  tools:ignore="NewApi">@color/red</item>        <item name="background">@color/red</item>    </style></resources>
查看完整描述

3 回答

?
MMMHUHU

TA貢獻(xiàn)1834條經(jīng)驗(yàn) 獲得超8個(gè)贊

嘗試這個(gè):


<style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light">

    <item name="android:actionBarStyle">@style/MyActionBar</item>

    <item name="actionBarStyle">@style/MyActionBar</item>


</style>


<style name="MyActionBar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">


    <item name="android:background">@color/red</item>

    <item name="background">@color/red</item>


</style>


查看完整回答
反對(duì) 回復(fù) 2019-12-03
?
侃侃無極

TA貢獻(xiàn)2051條經(jīng)驗(yàn) 獲得超10個(gè)贊

嘗試這個(gè)。


<style name="AppBaseTheme" parent="Theme.AppCompat.Light">

    <item name="colorPrimary"> #6699FF </item>

</style>

您可以#6699FF根據(jù)自己的選擇更改顏色(或使用顏色資源)。


查看完整回答
反對(duì) 回復(fù) 2019-12-03
  • 3 回答
  • 0 關(guān)注
  • 409 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)