문제

I need a SearchView inside a LinearLayout and I have to support API level 7 and higher. Is it possible to use the support-v7 libraries for this? All the questions in here are about using the support-v7 searchview widget in the actionbar. Does anyone know how to use it in the layout? Thanks.

도움이 되었습니까?

해결책

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

<android.support.v7.widget.SearchView
    android:id="@+id/search"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:queryHint="@string/search_hint"
    app:iconifiedByDefault="false" />

</LinearLayout>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top