【问题标题】:How to change distance between NavigationButton an ActionBar title in Nativescript?如何在 Nativescript 中更改 NavigationButton 和 ActionBar 标题之间的距离?
【发布时间】:2017-08-26 19:02:47
【问题描述】:

我想减少 NativeScript 应用程序中 NavigationButton 和 ActionBar 标题之间的距离。 iOS 和 Android 如何做到这一点?

【问题讨论】:

  • 它们之间没有距离,它们完全是一个在另一个之下。或者是你想要改变的 ActionBar 高度,也许是一个较低的值?您是否尝试设置 css height 属性?您是否尝试将 height 属性放在 ActionBar 元素上?
  • @pkanev 我不想改变高度或垂直距离。我想改变汉堡菜单图标和“主页”文本之间的水平距离。
  • 因此更改按钮和/或标签的内边距/边距。
  • @pkanev "Home" 文本不在标签标签中。它是 ActionBar 的标题属性。我无法设置它的填充或边距。汉堡菜单图标位于 NavigationButton 中,没有边距或填充。据我所知,我们不能在 Nativescript 中为元素设置负边距。看来我必须将标题文本设置为标签元素。
  • @pkanev 我使用了标签而不是标题属性。结果是一样的,我无法通过更改填充和边距来修复它,因为它们已经是 0。

标签: android-actionbar nativescript angular2-nativescript


【解决方案1】:

您可以通过在操作项中使用标签来自定义它,将其放置在操作栏上的任何位置 - 您可以按照自己的方式设置样式。

<ActionBar>
<ActionItem ios.position="popup" (tap)="capturePhoto($event)" android.position="popup" text="delete">

<Label  class="font-awesome actionItemLabel" text="&#xf03e;" color="white" style="font-size: 26; background-color: transparent; width: 40px; text-align: left;"></Label> 

</ActionItem>
</ActionBar>

【讨论】:

  • 你可以用它来增加 NavigationButton 和 ActionBar 之间的距离,但不能减少它。
猜你喜欢
  • 2017-04-09
  • 1970-01-01
  • 2014-12-21
  • 1970-01-01
  • 2017-11-24
  • 2021-06-13
  • 2021-11-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多