NativeScript/nativescript-sdk-examples-js

new FlexboxLayout

Closed this issue · 2 comments

I have read the docs
But I can't find out how to import the FlexboxLayout from module

I tried

const FlexboxLayout = require("tns-core-modules/ui/layouts/flexbox-layout").FlexboxLayout;

and it crashed when I called let fbl = new FlexboxLayout()
Any idea?

Hi @b02505048,
Excuse me for the delayed reply.
For JavaScript project, you can import the FlexboxLayout the same way you have shown above.

const FlexboxLayout = require("tns-core-modules/ui/layouts/flexbox-layout").FlexboxLayout;

For TypeScript

import {FlexboxLayout} from "tns-core-modules/ui/layouts/flexbox-layout";
lock commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.