Android Custom ActionBar with Search View

前端 未结 1 350
眼角桃花
眼角桃花 2021-01-16 03:45

I am using custom ActionBar library in my Android App. there i want to show a searchView but can not find any solution, i m working in library that is
https://github.co

1条回答
  •  走了就别回头了
    2021-01-16 04:45

    Take a look at this answer. According to this answer SearchView is available support library. add dependency to build.gradle

    compile 'com.android.support:appcompat-v7:22.0.0'
    

    and make imports

    import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.SearchView;

    According to this answer it worked on API 8 on emulator. For more details, check the link with the question and answer itself. Hope it helps.

    UPDATE

    By adding this code

    
    
    
    
    

    you can achieve this:

    enter image description here

    You can customize items in the way you want. For more details see this example.

    0 讨论(0)
提交回复
热议问题