Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 如何在操作栏“Nativescript”中添加三个操作项_Angular_Nativescript - Fatal编程技术网

Angular 如何在操作栏“Nativescript”中添加三个操作项

Angular 如何在操作栏“Nativescript”中添加三个操作项,angular,nativescript,Angular,Nativescript,我想要一个菜单栏图标在左边,一个标签在中间,最后是另一个添加图标,这将打开模式,但我面临的问题是,添加图标是放置在左上方的菜单栏图标每次 我试过android.position,里面有一个stacklayout,但还是一样的问题 它每次都会覆盖左边的一个。将此示例代码用于带有三个操作项的自定义操作栏 Nativescript代码:- <ActionBar backgroundColor="#007FA3"> <GridLayout columns=&

我想要一个菜单栏图标在左边,一个标签在中间,最后是另一个添加图标,这将打开模式,但我面临的问题是,添加图标是放置在左上方的菜单栏图标每次

我试过android.position,里面有一个stacklayout,但还是一样的问题


它每次都会覆盖左边的一个。

将此示例代码用于带有三个操作项的自定义操作栏

Nativescript代码:-

<ActionBar backgroundColor="#007FA3">
    <GridLayout columns="auto,*,auto" orientation="horizontal" ios:padding="0 10" height="100%" width="100%">
        <Image width="25" height="25" src="~/app/icons/left_wht.png" horizontalAlignment="left"
            verticalAlignment="center" class="action-bar-nav" col="0" tintColor="#ffffff">
        </Image>
        <Label text="PageTitle" fontSize="22" color="white" horizontalAlignment="center" verticalAlignment="center"
            col="1"></Label>
        <Image width="25" height="25" src="~/app/icons/shopping-cart.png" verticalAlignment="center" col="2"
            tintColor="#ffffff" marginRight="15"></Image>
    </GridLayout>
</ActionBar>

Android本质上不允许您将ActionItem放在左侧。这是iOS唯一的功能。您可以在NavigationButton上指定所需的图标,这可能会给您提供等效的或完全使用操作栏上的图标,这也将允许您将标签放在中心。好的,但我必须使用标签而不是NavigationButton来实现它