Fra87
Fra87

Reputation: 307

Android Searchview on top

I want put ont top layout SearchView. I have MyActivity with SearcView and below it there is RecyclerView, when i open MyActivity it show first RecyclerView, if i want see SearchView i scroll upward. How i set MyActivity so that when i open MyActivity, it show me first SearchView?

<ScrollView
android:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:fillViewport="true">

 <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:orientation="vertical">
        <SearchView
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:queryHint="Evento"
            android:id="@+id/cercaEvento"/>

    </LinearLayout>
 ......
</ScrollView>

Upvotes: 0

Views: 886

Answers (2)

CooL AndroDev
CooL AndroDev

Reputation: 51

Try this.this is solve your problem

http://javapapers.com/android/android-searchview-action-bar-tutorial/

Upvotes: 1

Chenmin
Chenmin

Reputation: 121

<RelativeLayout>
   <SearchView>
   <RecyclerView>
</RelativeLayout>

Upvotes: 0

Related Questions