中心定位可能在动作条?能在、动作、中心

2023-09-12 02:59:17 作者:彼岸之花、开了一夏

是否有可能集中在动作条什么?我知道APPICON,appLogo或标签可以在清单中设置的,但它会自动跳转到左侧。反正拿的标志或名称,并将其定位到中心?

Is it possible to center anything in the actionbar? I know that the appIcon, appLogo, or the label can be set in the manifest, but it automatically jumps to the left side. Is there anyway to take the logo or title and position it to the center?

我发现这个谷歌上的一些讨论,但大多是提Adobe Flex的的

推荐答案

想通了,你可以在动作条自定义布局。创建一个自定义布局(就在中心的XML图像或文字),然后调用它的动作条。

Figured out that you can have a custom layout in the actionbar. Create a custom layout (Just center an image or text in xml) and then call it in the actionbar.