Reputation: 585
I am newbie to Android and working on a SearchView demo for learning purposes.
I have put a SearchView inside my Activity and I want that SearchView collapsed by default till the user expands it, but currently it is expanded by default.
So can anybody help me?
my code is as below:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<SearchView
android:id="@+id/searchViewSearchPosts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:showAsAction="collapseActionView|ifRoom"
android:iconifiedByDefault="true"
android:queryHint="Search.." >
</SearchView>
<FrameLayout
android:id="@+id/fragmentTimeline"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_marginTop="0dp" />
</LinearLayout>
manifest
<activity
android:name="one.tusk.stush.SearchPostActivity"
android:parentActivityName="one.tusk.stush.activities.MainActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustNothing"
android:label="Back">
>
</activity>
Upvotes: 1
Views: 652