且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

更换操作栏的冠军,微调(下拉)

更新时间:2023-09-21 20:58:40

动作查看 S在菜单中总是会右对齐。如果你希望你的微调来左对齐,倒不如将其设置为在查看 C $ C>动作条使用 setCustomView()方法。自定义查看将调整到左边默认,并会拿冠军的地方,如果这是隐藏的。请注意,这需要你调用 setDisplayShowCustomEnabled(真)动作条

Action Views in the menu are always going to align to the right. If you want your Spinner to align left, it would be better to set it as a custom View on the ActionBar using the setCustomView() method. A custom View will align to the left by default, and will take the place of the title if that is hidden. Please note that this requires that you call setDisplayShowCustomEnabled(true) on the ActionBar.