Readonly
iosReadonly
androidOptional
popOptional
tabReadonly
transitionReadonly
layoutGets the main layout of Page which is an instance of UI.FlexLayout. You should add views to the layout of the page.
0.1
Readonly
statusGets status bar object. This property is readonly, you can not set status bar to a page but you can change properties of page's status bar.
4.0.0 Use Application.statusBar instead
0.1
Optional
Readonly
headerGets header bar object of a page. This property is readonly, you can not set header bar to a page but you can change properties of page's header bar. In Android, header bar properties should be implemented in onLoad or onShow of page. Otherwise given settings might be losed.
0.1
Gets/sets the orientation of the Page. This property must be set as constructor parameter. UI.Page.Orientation Orientation constants can use with bitwise or operator. The default value of the orientation defined in project.json.
import Page from '@smartface/native/ui/page';
var myPage1 = new Page({
orientation: Page.Orientation.LANDSCAPELEFT
});
= UI.Page.Orientation.PORTRAIT]
0.1
Gets/sets the parentcontroller(viewcontroller etc.) of the current page on iOS. You should access headerbar values through parentcontroller on iOS.
Optional
params: { controller: IController<any>; animated: any; isComingFromPresent?: boolean; onCompleteCallback?: (() => void) }Optional
isOptional
onThis event is called when a page appears on the screen (everytime). It will be better to set headerBar and statusBar properties in this callback.
import Page from '@smartface/native/ui/page';
const page = new Page();
page.on('show', () => {
console.info('onShow');
});
This function shows up the pop-up page. Pop-up pages behave exactly as UI.Page .
const self = this; //Current page
import Color from '@smartface/native/ui/color';
var popuPage = new Page();
popuPage.layout.backgroundColor = Color.BLUE;
import Button from '@smartface/native/ui/button';
var myButton = new Button({
width: 150,
height: 80,
text: "Smartface Button",
onPress: function() {
self.dismiss(function() {
console.log("dismiss")
});
}
});
popuPage.layout.addChild(myButton);
self.popupBtn.onPress = function() {
self.present({
controller: popuPage,
animated: true,
onComplete: function() {
console.log("Page3 presented...");
};
});
}
present
3.1.1
Optional
params: ControllerParamsThis function dismiss presently shown pop-up page.
dismiss
3.1.1
Optional
params: { onComplete: (() => void); animated?: boolean }Optional
animated?: booleanCreates an event emitter instance to listen for the actions
Call the function to remove the event
Gets as any arguments as it needs
Rest
...args: any[]Removes the specified event and invokes the callback after it is removed
Rest
...args: any[]Triggers the event manually.
Arguments that needs to be passed down
Rest
...args: any[]Creates an event emitter instance to listen for the actions
Call the function to remove the event
Gets as any arguments as it needs
Rest
...args: any[]Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.
Rest
...args: any[]Adds a one-time listener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.
Rest
...args: any[]This event will be called when orientation of the Page changes. iOS fires this event before orientation changed but Android fires after changed.
onOrientationChange
0.1
import Page from '@smartface/native/ui/page';
const page = new Page();
page.on(Page.Events.OrientationChange, (params) => {
console.info('onOrientationChange', params);
});
Generated using TypeDoc
Gets/sets custom transition views. Used with custom transitions to map a UI.View View from a removed or hidden UI.Page Page to a UI.View View from a shown or added UI.Page Page.
Example
Property
Android
Ios
Since
3.2.0