Protected
_nativeGets/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.
import Page from '@smartface/native/ui/page';
var myPage = new Page({
var page = this;
onShow: function() {
page.headerBar.visible = true;
page.imageView1.transitionID = "view1";
page.imageView2.transitionID = "view2";
page.transitionViews = [page.imageView1, page.imageView2];
}
});
var myDetailPage = new Page({
var page = this;
onShow: function() {
page.headerBar.visible = true;
}
page.imageView1.transitionID = "view2";
page.imageView2.transitionID = "view1";
});
3.2.0
Gets the main layout of Page which is an instance of UI.FlexLayout. You should add views to the layout of the page.
0.1
Gets 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
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
Static
iOSStatic
OrientationAdds 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.
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.
Creates an event emitter instance to listen for the actions
Call the function to remove the event
Gets as any arguments as it needs
Creates an event emitter instance to listen for the actions
Call the function to remove the event
Gets as any arguments as it needs
Removes the specified event and invokes the callback after it is removed
Triggers the event manually.
Rest
...args: any[]Arguments that needs to be passed down
Protected
preProtected
addProtected
addIOSPropsProtected
createThis 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');
});
Optional
isOptional
onThis 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);
});
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: ControllerParamsOptional
params: Partial<Page<"load" | "dismissComplete" | "dismissStart" | "dismissCancel" | "hide" | "show" | "orientationChange" | "safeAreaPaddingChange", any, IPage<"load" | "dismissComplete" | "dismissStart" | "dismissCancel" | "hide" | "show" | "orientationChange" | "safeAreaPaddingChange", MobileOSProps<PageIOSParams, PageAndroidParams>, any>>>Generated using TypeDoc
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.
Example
Property
= UI.Page.Orientation.PORTRAIT]
Android
Ios
Since
0.1