Android 操作栏 sherlok 不显示分隔线
我正在使用 sherlok-actionbar 并尝试在操作按钮之间应用分隔线。 我有 th 样式,但分隔线不可见,为什么?
<style name="Theme.SherlockCustom" parent="@style/Theme.Sherlock.Light">
<item name="abBackground">@drawable/actionbar_gradient</item>
<item name="abIcon">@drawable/logo</item>
<item name="abDivider">@drawable/ab_divider</item>
</style>
谢谢!
I'm using the sherlok-actionbar and trying to apply a divider between the action buttons.
I have th style but the dividers are not visible, why?
<style name="Theme.SherlockCustom" parent="@style/Theme.Sherlock.Light">
<item name="abBackground">@drawable/actionbar_gradient</item>
<item name="abIcon">@drawable/logo</item>
<item name="abDivider">@drawable/ab_divider</item>
</style>
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ActionBarSherlock v3.5 已更新,包含来自 Ice Cream Sandwich 的所有与操作项相关的视图和类的源。这意味着在两个操作项之间放置分隔线的规则遵循与 ICS 上相同的规则。
分隔线仅在以下各项之间显示:
如果您想覆盖此行为(仅限 3.0 之前),请使对
ActionItemView.java
进行以下更改:ActionBarSherlock v3.5 was updated to include the sources from Ice Cream Sandwich for all action-item related views and classes. This means that the rules for placing a divider between two action items follows the same rules as it would on ICS.
A divider would only be shown between the following:
If you want to override this behavior (on pre-3.0 only) make the following change to
ActionItemView.java
:您可以做的是在操作栏项目旁边添加一个视图,该视图看起来像分隔符(适用于所有 Android 版本)
,而 ActionSeparatorView 是 ImageView 的简单扩展,其中包含您想要显示为分隔符的可绘制对象
What you can do is to add a view next to the actionbar item that will look like the separator (works on all Android versions)
and the ActionSeparatorView is a simple extension of the ImageView with the drawable you want to show as a separator