and*_*per 11 android up-button searchview android-5.0-lollipop
我的应用程序能够使用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" />
Run Code Online (Sandbox Code Playgroud)
"colorPrimary"设置为:#ffEFEFEF.
此外,主题的活动的父级是"Theme.AppCompat.Light.NoActionBar",因为我已将工具栏设置为actionBar.
我该如何解决这个问题?
这个问题的原因是什么?为什么它在其他Android版本上运行良好?
and*_*per 17
这似乎是一个已知问题:https://code.google.com/p/android/issues/detail?id = 78346.
解决方法如下: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>
Run Code Online (Sandbox Code Playgroud)
而已.希望以后修好.
为了自定义它,我假设我可以使用它,并使用"colorControlNormal"选择颜色
我猜你的"app:collapseIcon"属性是你想要的吗?
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbarHeight"
app:collapseIcon="@drawable/collapseBackIcon" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6544 次 |
| 最近记录: |