背景
My app https://play.google.com/store/apps/details?id=com.lb.app_manager能够使用 ActionBar 上的 SearchView 搜索项目(其他应用程序)。
该应用程序使用Google的支持库,并且它可以在API 9以上的所有版本的Android上运行良好。
问题
在 Lollipop 上,当我单击搜索操作项以开始搜索时,我注意到左上角的向上/后退按钮变为白色,这对这种情况很不利,因为操作栏背景也很白色:
奇怪的是,它并不总是发生,而且我认为它不会发生在非 Lollipop 的 Android 版本上(在多个模拟器和设备上测试)。
另一个奇怪的事情是导航抽屉图标看起来不错,还有 searchView 内的 X 图标。
这是我的工具栏的 XML:
<android.support.v7.widget.Toolbar
android:id="@+id/activity_app_list__toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize" />
“colorPrimary”设置为:#ffEFEFEF。
另外,主题的活动父级是 "Theme.AppCompat.Light.NoActionBar" ,因为我已将工具栏设置为 actionBar。
问题
我该如何解决这个问题?
造成这个问题的原因是什么?为什么它在其他 Android 版本上运行良好?
这似乎是一个已知问题:https://code.google.com/p/android/issues/detail?id=78346 https://code.google.com/p/android/issues/detail?id=78346 .
解决方法在这里:https://code.google.com/p/android/issues/detail?id=78346#c5 https://code.google.com/p/android/issues/detail?id=78346#c5, 意义:
值-21/themes.xml:
<style name="MyTheme" parent="Theme.AppCompat">
<item name="homeAsUpIndicator">@drawable/abc_ic_ab_back_mtrl_am_alpha</item>
</style>
就是这样。希望以后能修好。
为了自定义它,我假设我可以使用它,并且还使用“colorControlNormal”选择颜色
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)