0

アプリに次のような Appbarlayout があります。

<android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:background="#33000000"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <android.support.v7.widget.Toolbar
            android:id="@+id/toolBar"
            app:titleTextColor="@color/light_blue"
            android:title="@{viewModel.title}"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_scrollFlags="enterAlways" />
        <SearchView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/searchView"
            android:queryBackground="@android:color/transparent"
            android:searchHintIcon="@drawable/ic_search"
            app:searchIcon="@drawable/ic_search"
            android:iconifiedByDefault="false"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
            app:defaultQueryHint="Search"
            android:queryHint="Search" />
    </android.support.design.widget.AppBarLayout>

これは API23 デバイスでは問題なく動作しますが、API24 デバイスでは、「wrap_content」が検索ビューを非表示にし、ツールバーのみが表示されます...

私がこれを行う場合:

<android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:background="#33000000"
        android:layout_width="match_parent"
        android:layout_height="150dp">

どちらも問題なく表示されます。

ここで何が起きてるの?これはバグですか?

これは API24 エミュレーターにあります。

ここに画像の説明を入力

API23 エミュレーターでは、同じコード:

ここに画像の説明を入力

4

0 に答える 0