Android: dynamically change ActionBar icon?

后端 未结 4 1689
谎友^
谎友^ 2020-12-23 17:37

I would like to dynamically change the \"home\" icon in the ActionBar. This is easily done in v14 with ActionBar.setIcon(...), but I can\'t find anyway to accomplish this i

4条回答
  •  爱一瞬间的悲伤
    2020-12-23 18:20

    The ActionBar will use the android:logo attribute of your manifest, if one is provided. That lets you use separate drawable resources for the icon (Launcher) and the logo (ActionBar, among other things).

提交回复
热议问题