【问题标题】:Android - Remove/Add padding between buttons on AtionBarCompatAndroid - 在 AtionBarCompat 上的按钮之间删除/添加填充
【发布时间】:2012-06-08 07:26:23
【问题描述】:

我正在使用 ActionBar Compatibility,一切都很好,除了默认情况下,按钮(操作)周围有一些填充。

如何更改特定按钮的填充,删除它,并在某些情况下进行调整。

【问题讨论】:

  • 如何添加按钮。过去,为了在(本质上)使用自定义按钮、间距等更改菜单中的属性......我不得不构建自己的菜单。以下 StackOverflow 问题中有一些很好的链接。 stackoverflow.com/questions/1593529/…
  • 按钮是从 menu.xml 资源扩展而来的,就像任何其他常规选项菜单一样。感谢您的链接。
  • 我已阅读示例。好吧,在我的情况下,使用选项菜单似乎比使用 ActionBar 更容易适应。
  • 你有你的 menu.xml 代码吗?

标签: android android-layout android-emulator android-actionbar


【解决方案1】:

我设法通过配置样式创建自定义布局并将其附加到 ActionBar 来解决此问题:

<style name="ActionBar" parent="android:style/Widget.Holo.Light.ActionBar">
   <item name="android:displayOptions">showHome|useLogo|showCustom</item>
   <item name="android:customNavigationLayout">@layout/actionbar_custom_title</item>
</style>

现在出现了另一个问题:如果你能帮助我,请看这个帖子:Android - Remove "More actions" button from the ActionBar

【讨论】:

    猜你喜欢
    • 2021-10-22
    • 2012-06-12
    • 2012-01-05
    • 2017-03-08
    • 2015-02-04
    • 1970-01-01
    • 2011-07-27
    • 2021-09-12
    • 2016-04-20
    相关资源
    最近更新 更多