Prev Next

Web / Nativescript interview questions

Could not find what you were looking for? send us the question and we would be happy to answer your question.

1. What is NativeScript?

NativeScript is a cross-platform JavaScript framework that lets you develop native iOS and Android apps from a single code base. The framework provides JavaScript access to the native APIs, user interface, and rendering engines of iOS and Android. By using JavaScript or TypeScript, you can create one project that builds into an iOS or Android app with completely native user experience.

2. Does NativeScript use WebView?

No, NativeScript doesn't use WebView component. NativeScript maps the UI markup in your code to native components as per Apple and Android had intended and renders as native app.

3. Different Layout containers in Nativescript.

The AbsoluteLayout is the simplest layout in NativeScript. It uses absolute left-top coordinates to position its children.

The DockLayout is a layout that provides a docking mechanism for child elements to the left, right, top, bottom, or center of the layout. To define the docking side of a child element, use its dock property.

The GridLayout is a layout that arranges its child elements in a table structure of rows and columns. A cell can contain multiple child elements, they can span over multiple rows and columns, and even overlap each other.

The StackLayout stacks its child elements below or beside each other, depending on its orientation. It is very useful to create lists.

The WrapLayout is similar to the StackLayout, but it does not just stack all child elements to one column/row, it wraps them to new columns/rows if no space is left.

The FlexboxLayout is a non-conforming implementation of the CSS Flexible Box Layout based on an existing Apache-2 licensed flexbox implementation.

4. What are the NativeScript Application events?
  • launch: This event is raised when application launch.
  • suspend: This event is raised when the application is suspended.
  • resume: This event is raised when the application is resumed after it has been suspended.
  • displayed: This event is raised when the UIelements are rendered.
  • orientationChanged: This event is raised when the device changes orientation.
  • lowMemory: This event is raised when the memory on the target device is low.
  • uncaughtError: This event is raised when an uncaught application error is present.
  • exit: This event is raised when the application is about to exit.
5. Name a few AutoInjected objects in Nativescript Angular components.

"ui/page".Page: the native page the component renders on. The router implementation takes care to inject the correct instance when loading components on different pages.

"platform".Device: contains information about the device the application is running on.

«
»
React native

Comments & Discussions