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

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

如何更改新材質(zhì)主題中后退箭頭的顏色?

如何更改新材質(zhì)主題中后退箭頭的顏色?

牧羊人nacy 2019-11-22 14:02:59
我已將SDK更新為API 21,現(xiàn)在“后退/向上”圖標(biāo)是一個(gè)指向左側(cè)的黑色箭頭。黑色后退箭頭我希望它是灰色的。我怎樣才能做到這一點(diǎn)?例如,在Play商店中,箭頭為白色。我這樣做是為了設(shè)置一些樣式。我已經(jīng)習(xí)慣@drawable/abc_ic_ab_back_mtrl_am_alpha了homeAsUpIndicator。該可繪制對(duì)象是透明的(僅Alpha),但是箭頭顯示為黑色。我不知道是否可以像在筆記本上一樣設(shè)置顏色DrawerArrowStyle?;蛘?,如果唯一的解決方案是創(chuàng)建my @drawable/grey_arrow并將其用于homeAsUpIndicator。<!-- Base application theme --><style name="AppTheme" parent="Theme.AppCompat.Light">    <item name="android:actionBarStyle" tools:ignore="NewApi">@style/MyActionBar</item>    <item name="actionBarStyle">@style/MyActionBar</item>    <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>    <item name="homeAsUpIndicator">@drawable/abc_ic_ab_back_mtrl_am_alpha</item>    <item name="android:homeAsUpIndicator" tools:ignore="NewApi">@drawable/abc_ic_ab_back_mtrl_am_alpha</item></style><!-- ActionBar style --><style name="MyActionBar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid">    <item name="android:background">@color/actionbar_background</item>    <!-- Support library compatibility -->    <item name="background">@color/actionbar_background</item></style><!-- Style for the navigation drawer icon --><style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">    <item name="spinBars">true</item>    <item name="color">@color/actionbar_text</item></style>到目前為止,我的解決方案是采用@drawable/abc_ic_ab_back_mtrl_am_alpha似乎是白色的,并使用照片編輯器將其繪制為所需的顏色。它可以工作,盡管我更喜歡在中使用@color/actionbar_textlike DrawerArrowStyle。
查看完整描述

3 回答

?
拉莫斯之舞

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

查看Toolbar和TintManager來(lái)源,drawable/abc_ic_ab_back_mtrl_am_alpha以style屬性的值進(jìn)行著色colorControlNormal。


我確實(shí)嘗試在我的項(xiàng)目中設(shè)置此<item name="colorControlNormal">@color/my_awesome_color</item>主題(帶有主題),但對(duì)我來(lái)說(shuō)仍然是黑色的。


更新:


找到了。您需要使用設(shè)置actionBarTheme屬性(不是 actionBarStyle)colorControlNormal。


例如:


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

    <item name="actionBarTheme">@style/MyApp.ActionBarTheme</item>

    <item name="actionBarStyle">@style/MyApp.ActionBar</item>

    <!-- color for widget theming, eg EditText. Doesn't effect ActionBar. -->

    <item name="colorControlNormal">@color/my_awesome_color</item>

    <!-- The animated arrow style -->

    <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>

</style>


<style name="MyApp.ActionBarTheme" parent="@style/ThemeOverlay.AppCompat.ActionBar">       

    <!-- THIS is where you can color the arrow! -->

    <item name="colorControlNormal">@color/my_awesome_color</item>

</style>


<style name="MyApp.ActionBarStyle" parent="@style/Widget.AppCompat.Light.ActionBar">

    <item name="elevation">0dp</item>      

    <!-- style for actionBar title -->  

    <item name="titleTextStyle">@style/ActionBarTitleText</item>

    <!-- style for actionBar subtitle -->  

    <item name="subtitleTextStyle">@style/ActionBarSubtitleText</item>


    <!-- 

    the actionBarTheme doesn't use the colorControlNormal attribute

    <item name="colorControlNormal">@color/my_awesome_color</item>

     -->

</style>


查看完整回答
反對(duì) 回復(fù) 2019-11-22
?
夢(mèng)里花落0921

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

嘗試了以上所有建議。我設(shè)法在工具欄中更改導(dǎo)航圖標(biāo)默認(rèn)后退按鈕箭頭顏色的唯一方法是在基本主題中設(shè)置colorControlNormal,如下所示。可能是因?yàn)楦讣?jí)正在使用Theme.AppCompat.Light.NoActionBar


<style name="BaseTheme" parent="Theme.AppCompat.Light.NoActionBar">

  <item name="colorControlNormal">@color/white</item> 

  //the rest of your codes...

</style>


查看完整回答
反對(duì) 回復(fù) 2019-11-22
  • 3 回答
  • 0 關(guān)注
  • 580 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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