我的应用程序样式层次结构如下:
<style name="MiddleBaseApTheme" parent="@style/BaseAppTheme">
<item name="android:actionBarStyle" tools:targetApi="11">@style/MainActionBarStyle</item>
<item name="navigationIcon">@drawable/ic_arrow_back_black56</item>
<item name="actionBarStyle">@style/MainActionBarStyle</item>
</style>
然后,我将动作栏样式定义为:
<style name="MainActionBarStyle" parent="@style/Widget.AppCompat.Light.ActionBar.Solid">
<item name="android:elevation" tools:targetApi="21">@dimen/action_bar_elevation</item>
<item name="elevation">@dimen/action_bar_elevation</item>
<item name="popupTheme">@style/CustomPopup</item>
<item name="android:background">@android:color/holo_red_light</item>
<!-- Support library compatibility -->
<item name="background">@android:color/holo_red_light</item>
</style>
这已成功将app栏显示为:
现在我想更进一步尝试:
<item name="searchViewStyle">@style/AppTheme.SearchView</item>
在MiddleBaseTheme上,AppTheme.SearchView包含AutoCompleteBox TextView样式:
<style name="AppTheme.SearchView" parent="Widget.AppCompat.Light.SearchView">
<item name="android:autoCompleteTextViewStyle">@style/AutoCompleteTextView</item>
</style>
但这并没有在Action栏上显示任何SearchView ......为什么?