【问题标题】:Replicate Ionic2 style Left Side Menu in NativeScript with Angular2使用 Angular2 在 NativeScript 中复制 Ionic2 样式的左侧菜单
【发布时间】:2016-10-26 05:34:51
【问题描述】:

Ionic2 根据图片提供了带有左侧菜单滑块的漂亮模板:

Angular2 有任何 NativeScript 方法吗?

我将npm i nativescript-telerik-ui 安装到项目中,例如http://docs.telerik.com/devtools/nativescript-ui/Controls/Angular/SideDrawer/getting-started 将html 代码放入我的文件中:

<RadSideDrawer exampleTitle toggleNavButton>
    <StackLayout tkDrawerContent class="sideStackLayout">
        <StackLayout class="sideTitleStackLayout">
            <Label text="Navigation Menu"></Label>
        </StackLayout>
        <StackLayout class="sideStackLayout">
            <Label text="Primary" class="sideLabel sideLightGrayLabel"></Label>
            <Label text="Social" class="sideLabel"></Label>
            <Label text="Promotions" class="sideLabel"></Label>
            <Label text="Labels" class="sideLabel sideLightGrayLabel"></Label>
            <Label text="Important" class="sideLabel"></Label>
            <Label text="Starred" class="sideLabel"></Label>
            <Label text="Sent Mail" class="sideLabel"></Label>
            <Label text="Drafts" class="sideLabel"></Label>
        </StackLayout>
    </StackLayout>
    <StackLayout tkMainContent>
        <Label [text]="mainContentText" textWrap="true" class="drawerContentText"></Label>
        <Button text="OPEN DRAWER" (tap)=openDrawer()></Button>
    </StackLayout>
</RadSideDrawer>

但是一旦我运行tns run android --emulator,我就看不到 Deawer 出现在屏幕上。

【问题讨论】:

    标签: ionic2 angular2-nativescript nativescript-telerik-ui


    【解决方案1】:

    也许您忘记将SIDEDRAWER_DIRECTIVES 包含在引导的@NgModule 的declarations 中。

    您可以在 {N} + Angular 应用程序here 中查看有关如何使用 RadSideDrawer 或 nativescript-telerik-ui 插件的任何其他 UI 元素的完整详细信息。有关 RadSideDrawer 的具体细节,您可以查看其官方文档here。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-08-31
      • 1970-01-01
      • 1970-01-01
      • 2017-09-13
      • 1970-01-01
      • 2017-03-12
      • 2012-11-14
      相关资源
      最近更新 更多