Custom Home Icon in Action Bar Sherlock

前端 未结 4 550
名媛妹妹
名媛妹妹 2021-02-03 21:34

I am trying to set custom icon for home icon using ActionBarSherlock library. I have tried to set custom layout using abHomeLayout attribute in my custom theme. But

4条回答
  •  时光取名叫无心
    2021-02-03 22:01

    This works for my situation, it replaces the default ic_launcher icon in the action bar with my custom one.

    In your onCreate do this:

    getSupportActionBar().setIcon(R.drawable.audio_shortcut);
    

    Or in the manifest you can set the logo:

    
        android:logo="@drawable/my_custom_logo"
        ...
    
    

提交回复
热议问题