NativeScript for Mobile App Development Navigation and Routing 2 — Questions and Answers
Question 1: What NativeScript component creates a side-drawer navigation pattern?
- RadSideDrawer (Correct answer)
- DrawerLayout
- SideNav
- NavigationDrawer
Correct answer: RadSideDrawer
RadSideDrawer (from the NativeScript UI package) provides a slide-out drawer navigation menu common in mobile apps.
Question 2: Which Angular router directive marks where routed components are rendered in NativeScript Angular?
- page-router-outlet (Correct answer)
- router-outlet
- ns-router-outlet
- native-outlet
Correct answer: page-router-outlet
NativeScript Angular uses `<page-router-outlet>` instead of the standard `<router-outlet>` to render navigated pages as native Pages.
Question 3: What transition type slides the new page in from the right in NativeScript?
- slide (Correct answer)
- push
- slideRight
- enter
Correct answer: slide
The 'slide' transition name in a NavigationTransition causes the incoming page to slide in from the right, which is the default iOS navigation style.
Question 4: In NativeScript Vue, which method navigates to a new component?
- $navigateTo(ComponentName) (Correct answer)
- this.$router.push()
- $navigate(ComponentName)
- this.$goto(ComponentName)
Correct answer: $navigateTo(ComponentName)
NativeScript Vue provides $navigateTo() as the navigation method, accepting the target component and optional navigation options.
Question 5: What is a modal page in NativeScript?
- A page displayed on top of the current page without replacing it in the stack (Correct answer)
- A page with no back button
- A full-screen dialog only
- A page loaded in a web view
Correct answer: A page displayed on top of the current page without replacing it in the stack
Modal pages are shown as overlays on top of the current page and are dismissed by calling closeModal(), leaving the background page intact.
Question 6: Which property controls the animation speed of a NativeScript navigation transition?
- duration (Correct answer)
- speed
- animationDuration
- transitionTime
Correct answer: duration
The `duration` property of NavigationTransition specifies the transition animation length in milliseconds.
What NativeScript component creates a side-drawer navigation pattern?