我需要显示这两个图标
和标题
在动作条。
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" />