2

我正在尝试将我的 ActionBar 上的视图相对于整体宽度居中。我目前拥有的代码:

actionBar.setDisplayShowCustomEnabled(true);
actionBar.setCustomView(R.layout.action_bar_custom);

在 Home 按钮和 Menu 按钮的中间设置一个以重心为中心的线性布局,而不是直接在操作栏的中间。有些片段有菜单选项,有些没有,它们需要在那里。

我将如何实现这一目标?

目前正在发生的事情的例子:

http://i.stack.imgur.com/eHesR.png

http://i.stack.imgur.com/0QGhF.png

4

0 回答 0