Remove icon/title for actionbar with expanded SearchView?

后端 未结 3 1143
孤城傲影
孤城傲影 2021-01-11 22:41

I created a new project, targeting api 11 and above. I have an activity where I want a SearchView expanded by default:

@Override
public void onCreateOptionsM         


        
3条回答
  •  忘掉有多难
    2021-01-11 23:07

    I could not get @Vikram's awnser to work, but I found that another answer from Stack Overflow:

    Open your styles.xml file and add below codes in your Actionbar style

    showHome|homeAsUp|showTitle
    showHome|homeAsUp|showTitle
    @android:color/transparent <--this do the magic!
    

    p/s: I'm using Actionbar Sherlock and this works just fine

    (See Remove icon/logo from action bar on android work)

提交回复
热议问题