我正在建立一个阿拉伯语博客,因此我需要我的应用程序是我搜索过的RTL方向,我发现该插件来自nativescript-rtl/ui
的nativescript
我的代码: app.module.ts
import { registerElement } from "nativescript-angular/element-registry";
import * as rtl from '@nativescript-rtl/ui'
registerElement(
"RGridLayout",
() => rtl.GridLayout
);
registerElement(
"RWrapLayout",
() => rtl.WrapLayout
);
registerElement(
"RAbsoluteLayout",
() => rtl.AbsoluteLayout
);
registerElement(
"RDockLayout",
() => rtl.DockLayout
);
registerElement(
"RStackLayout",
() => rtl.StackLayout
);
home.component.html
<RGridLayout class="page page-content">
<ListView [items]="items" class="list-group">
<ng-template let-item="item">
<Label [nsRouterLink]="['../item', item.id]" [text]="item.name" class="list-group-item"></Label>
</ng-template>
</ListView>
</RGridLayout>