搜索视图展开时菜单项文本被剪切

时间:2019-10-12 20:30:55

标签: android navigation

我的操作栏中有一个可扩展的搜索视图和一个菜单项。当我展开搜索视图时,菜单项的文本被剪切。截图见下文。

有什么想法吗?

not expanded expanded

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.AddFindingActivity">

<com.google.android.material.appbar.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

</com.google.android.material.appbar.AppBarLayout>

<include layout="@layout/content_add_finding" />

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/search"
        android:title="Search Findings"
        android:icon="@drawable/ic_search"
        app:showAsAction="always"
        app:actionViewClass="android.widget.SearchView" />
    <item
        android:id="@+id/done"
        app:showAsAction="always"
        android:title="Done" />
</menu>

0 个答案:

没有答案
相关问题