如何同时显示图标和内部动作条行动头衔? [英] How to display both icon and title of action inside ActionBar?
本文介绍了如何同时显示图标和内部动作条行动头衔?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要显示这两个图标
和标题
在动作条$行动C $ C>。
I need to display both icon
and title
of action inside ActionBar
.
我已经试过 withText
选项,但没有效果。
I've tried "withText
" option, but it has no effect.
推荐答案
总是| withText 将工作,如果有足够的空间,否则只会地方图标。你可以旋转你的手机上进行测试。
'always|withText' will work if there is sufficient room, otherwise it will only place icon. You can test it on your phone with rotation.
<item android:id="@id/menu_item"
android:title="text"
android:icon="@drawable/drawable_resource_name"
android:showAsAction="always|withText" />
这篇关于如何同时显示图标和内部动作条行动头衔?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文