【问题标题】:How to use Image inside ActionItem/ ActionBar in IOS Nativescript如何在 IOS Nativescript 中的 ActionItem/ActionBar 中使用 Image
【发布时间】:2019-09-16 15:11:30
【问题描述】:

我在 ActionItem/ActionBar 中使用 Image,如下面的代码

<ActionBar class="action-bar">
       <ActionItem ios:position="left">
             <Image (tap)="toggle()" src="res://menu"></Image>
       </ActionItem>
       <ActionItem ios:position="right">
             <Image src="res://logo"></Image>
       </ActionItem>
</ActionBar>

问题是:在ActionBar中心视图中只显示第一张图片src="res://menu"

我想显示到图像,左边的第一张图片和右边的第二张图片。

你能问我如何实现吗?

谢谢!

【问题讨论】:

    标签: ios angular nativescript action


    【解决方案1】:

    您不能在 Android 中将 ActionItem 放置在 ActionBar 的左角。为此,您必须使用 NavigationButton,

    <ActionBar>
      <NavigationButton icon="res://menu" (tap)="toggle()" />
    </ActionBar>
    

    对于iOS,应该是ios.position

    <ActionBar class="action-bar">
           <ActionItem ios.position="left">
                 <Image (tap)="toggle()" src="res://menu"></Image>
           </ActionItem>
           <ActionItem ios.position="right">
                 <Image src="res://logo"></Image>
           </ActionItem>
    </ActionBar>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多