入门
开发指南
- 模块
- 控件基础知识
- 控件树
- 选择器 API
- 布局
- 手势和触摸事件
- W3C APIs 兼容
- Cordova 插件支持
- EcmaScript 6,TypeScript 和 JSX
- Windows 10 支持说明
- 构建 Tabris.js App
- Tabris.js App 补丁
API 参考文档
- app
- device
- fs
- localStorage
- ui
- ActionSheet(操作列表)
- AlertDialog(对话框)
- CanvasContext
- InactivityTimer(闲置定时器)
- NativeObject
- Popup(弹出窗)
- Timer(计时器)
- WidgetCollection
控件
- Action
- ActivityIndicator
- Button
- Canvas
- CheckBox
- CollectionView
- Composite
- Drawer
- ImageView
- NavigationBar
- NavigationView
- Page
- Picker
- ProgressBar
- RadioButton
- ScrollView
- SearchAction
- Slider
- StatusBar
- Switch
- Tab
- TabFolder
- TextInput
- TextView
- ToggleButton
- Video
- WebView
- Widget
自定义控件
NavigationView
Extends Composite
A widget that displays a stack of pages with a toolbar that allows to navigate back. The toolbar also displays the current page’s title and the highest priority actions that are added to the NavigationView. Only children of type Page
, Action
and Search Action
are supported. Since the NavigationView does not compute its own size, the width and height must be defined by the respective layout properties (e.g. either width
or left
and right
must be specified).
Import this type with “const {NavigationView} = require('tabris');
”
Methods
pages(selector)
Parameters:
- selector: Selector [Optional]
- a selector expression or a predicate function to filter the results.
Returns: WidgetCollection
Returns the ordered list of pages on the page stack, with the bottommost page as the first and the topmost page as the last element. Same as children(), but only returns children that are of type Page
.
Properties
actionColor
Type: Color
The color used for action icons.
actionTextColor
AndroidWindows 10
Type: Color
The color used for action texts. Only applied on Android and Windows. IOS uses the actionColor
to colorize the action text.
bottomToolbarHeight
Type: number
The height of the bottom toolbar. Is 0 if not visible or unsupported by the platform.
drawer ActionVisible
Type: boolean
Whether to display the so-called “Burger menu” to open the drawer.
pageAnimation
Type: string, supported values: default
, none
, default: default
Controls what animation to use when animating a page transition.
titleTextColor
Type: Color
The text color used for page titles.
toolbarColor
Type: Color
The background color of the toolbar.
toolbarVisible
Type: boolean, default: true
Whether the toolbar is visible.
topToolbarHeight
Type: number
The height of the top toolbar. Is 0 if not visible.
win_drawer ActionBackground
Windows 10
Type: Color
The background color used for the drawer action. It is common to the make this the same color as the splash screen. Available only on Windows.
win_drawer ActionTheme
Windows 10
Type: string, supported values: light
, dark
, default
, default: default
Controls the color scheme used for the drawer action. When set to "default"
the theme is inherited from the NavigationView. Available only on Windows.
win_toolbarOverflowTheme
Windows 10
Type: string, supported values: light
, dark
, default
, default: default
Controls the color scheme used for the toolbar’s overflow menu. When set to "default"
the theme is inherited from the toolbar. Available only on Windows.
win_toolbarTheme
Windows 10
Type: string, supported values: light
, dark
, default
, default: default
Controls the color scheme used for the toolbar. When set to "default"
the theme is inherited from the NavigationView. Available only on Windows.
Events
actionColorChanged
Fired when the actionColor property has changed.
Event Parameters
target: this The widget the event was fired on.
value: Color The new value of actionColor.
actionTextColorChanged
Fired when the actionTextColor property has changed.
Event Parameters
target: this The widget the event was fired on.
value: Color The new value of actionTextColor.
bottomToolbarHeightChanged
Fired when the height of the bottom toolbar changes, e.g. if it changes visibility.
Event Parameters
target: this The widget the event was fired on.
value: number The new value of bottomToolbarHeight.
drawer ActionVisibleChanged
Fired when the drawer ActionVisible property has changed.
Event Parameters
target: this The widget the event was fired on.
value: boolean The new value of drawer ActionVisible.
pageAnimationChanged
Fired when the pageAnimation property has changed.
Event Parameters
target: this The widget the event was fired on.
value: string The new value of pageAnimation.
titleTextColorChanged
Fired when the titleTextColor property has changed.
Event Parameters
target: this The widget the event was fired on.
value: Color The new value of titleTextColor.
toolbarColorChanged
Fired when the toolbarColor property has changed.
Event Parameters
target: this The widget the event was fired on.
value: Color The new value of toolbarColor.
toolbarVisibleChanged
Fired when the toolbarVisible property has changed.
Event Parameters
target: this The widget the event was fired on.
value: boolean The new value of toolbarVisible.
topToolbarHeightChanged
Fired when the height of the top toolbar changes, e.g. if it changes visibility.
Event Parameters
target: this The widget the event was fired on.
value: number The new value of topToolbarHeight.
win_drawerActionBackgroundChanged
Fired when the win_drawerActionBackground property has changed.
Event Parameters
target: this The widget the event was fired on.
value: Color The new value of win_drawerActionBackground.
win_drawerActionThemeChanged
Fired when the win_drawerActionTheme property has changed.
Event Parameters
target: this The widget the event was fired on.
value: string The new value of win_drawerActionTheme.
win_toolbarOverflowThemeChanged
Fired when the win_toolbarOverflowTheme property has changed.
Event Parameters
target: this The widget the event was fired on.
value: string The new value of win_toolbarOverflowTheme.
win_toolbarThemeChanged
Fired when the win_toolbarTheme property has changed.
Event Parameters
target: this The widget the event was fired on.
value: string The new value of win_toolbarTheme.
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论