ActionBar 选项卡的粗细/宽度
我有一个带有 3 个选项卡的操作栏。 它看起来像这样: |全部 |来电 |网络| 我希望它们具有相同的宽度。我该怎么做呢?
I have an action bar with 3 tabs in it.
It looks like this:
| All | Calls | Network |
I want them to have the same width. How can I do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 ActionBar.Tab 上的 setCustomView() 方法为任何视图设置标签。我就是这样做的。自定义视图是从布局加载的,在我的例子中,该布局类似于 ActionBar.Tag 使用的内置布局,您可以将边距、大小和内容设置为您需要的任何内容。
You can set a tag to any view using setCustomView() method on the ActionBar.Tab. This is how I did it. The custom view is loaded from a layout that in my case was similar to the built-in layout used by ActionBar.Tag, you set the margins, sizes, and content to whatever you need.
它们都以相同的宽度对齐在行中
然后将选项卡主机设置为
They all align in the row with same width
And then set tab host as
https://groups.google.com/forum/#!topic/actionbarsherlock/4oT9KwhB0O8
这就是我几天来一直在寻找的确切解决方案
https://groups.google.com/forum/#!topic/actionbarsherlock/4oT9KwhB0O8
This is the exact solution that I have been looking for days