
我在我的应用程序中使用工具栏进行材料设计.一切正常,但除了改变菜单项文字颜色,我完全坚持解决方案.我还发布了应该采取的文本的截图和我在我的应用程序中使用的代码供您参考.我尝试了几种替代方法,例如分配如下
<item name="androID:actionMenuTextcolor">@color/white</item><item name="androID:textcolor">#000</item>但是已知上述解决方案对我有用.
要求截图:
需要将SKIP菜单项从黑色更改为白色.
styles.xml
<style name="Toolbartheme" parent="@style/theme.AppCompat.light"> <item name="colorPrimary">@color/blue</item> <item name="colorPrimaryDark">@color/blue</item> <item name="windowNoTitle">true</item> <item name="windowActionbar">false</item> <item name="drawerArrowStyle">@style/DrawerArrowStyle</item> <item name="androID:actionMenuTextcolor">@color/white</item> <item name="androID:textcolor">#000</item> </style>toolbar.xml
<androID.support.v7.Widget.Toolbar xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:app="http://schemas.androID.com/apk/res-auto" androID:ID="@+ID/toolbar" androID:layout_wIDth="match_parent" androID:layout_height="?attr/actionbarSize" app:popuptheme="@style/themeOverlay.AppCompat.light" app:layout_scrollFlags="scroll|en@R_404_6704@lways" androID:fitsSystemwindows="true" androID:background="?attr/colorPrimary"/>舱单
<activity androID:name=".activity.HomeActivity" androID:label="@string/app_name" androID:screenorIEntation="portrait" androID:configChanges="keyboard|screenLayout|orIEntation" androID:theme="@style/Toolbartheme"></activity>我真的不知道我犯了什么错误.请帮我.提前致谢
解决方法:
改变这个
<item name="androID:actionMenuTextcolor">@color/white</item>至
<item name="actionMenuTextcolor">@color/white</item>并将主题应用于工具栏:
androID:theme="@style/Toolbartheme"您可以设置小部件的样式并为活动提供主题.
总结以上是内存溢出为你收集整理的android – 如何为Lollipop和Lollipop版本更改工具栏菜单项文本颜色全部内容,希望文章能够帮你解决android – 如何为Lollipop和Lollipop版本更改工具栏菜单项文本颜色所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)