Expand and give focus to SearchView automatically

后端 未结 17 2382
囚心锁ツ
囚心锁ツ 2020-12-02 18:21

I\'m developing an application where the user presses the \"Search\" icon in the ActionBar and a SearchView is made visible at the top of the scree

17条回答
  •  隐瞒了意图╮
    2020-12-02 18:39

    This worked for me :

    In the root layout :

    xmlns:app="http://schemas.android.com/apk/res-auto"
    

    SearchView defined as follows :

     
    
            
        
    

    The difference is with app tag.

    app:iconifiedByDefault="false"
    app:queryHint="Search name or email"
    

提交回复
热议问题