mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
Some typos fixed
This commit is contained in:
@ -68,7 +68,7 @@ class IOSApplication implements definition.iOSApplication {
|
|||||||
this.addNotificationObserver(UIApplicationDidEnterBackgroundNotification, this.didEnterBackground);
|
this.addNotificationObserver(UIApplicationDidEnterBackgroundNotification, this.didEnterBackground);
|
||||||
this.addNotificationObserver(UIApplicationWillTerminateNotification, this.willTerminate);
|
this.addNotificationObserver(UIApplicationWillTerminateNotification, this.willTerminate);
|
||||||
this.addNotificationObserver(UIApplicationDidReceiveMemoryWarningNotification, this.didReceiveMemoryWarning);
|
this.addNotificationObserver(UIApplicationDidReceiveMemoryWarningNotification, this.didReceiveMemoryWarning);
|
||||||
this.addNotificationObserver(UIDeviceOrientationDidChangeNotification, this.oreintationDidChange);
|
this.addNotificationObserver(UIDeviceOrientationDidChangeNotification, this.orientationDidChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
get nativeApp(): UIApplication {
|
get nativeApp(): UIApplication {
|
||||||
@ -162,7 +162,7 @@ class IOSApplication implements definition.iOSApplication {
|
|||||||
exports.notify({ eventName: definition.lowMemoryEvent, object: this, android: undefined, ios: UIApplication.sharedApplication() });
|
exports.notify({ eventName: definition.lowMemoryEvent, object: this, android: undefined, ios: UIApplication.sharedApplication() });
|
||||||
}
|
}
|
||||||
|
|
||||||
private oreintationDidChange(notification: NSNotification) {
|
private orientationDidChange(notification: NSNotification) {
|
||||||
var orientation = UIDevice.currentDevice().orientation;
|
var orientation = UIDevice.currentDevice().orientation;
|
||||||
|
|
||||||
if (this._currentOrientation !== orientation) {
|
if (this._currentOrientation !== orientation) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="onPageLoaded" unloaded="onPageUnloaded" navigatedTo="pageNavigatedTo">
|
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="onPageLoaded" unloaded="onPageUnloaded" navigatedTo="pageNavigatedTo">
|
||||||
<GridLayout>
|
<GridLayout>
|
||||||
<TextView text="{{ oreintation }}" />
|
<TextView text="{{ orientation }}" />
|
||||||
</GridLayout>
|
</GridLayout>
|
||||||
</Page>
|
</Page>
|
||||||
|
@ -5,14 +5,14 @@ import pageModule = require("ui/page");
|
|||||||
var vm = new observable.Observable();
|
var vm = new observable.Observable();
|
||||||
function orientationChanged(data) {
|
function orientationChanged(data) {
|
||||||
console.log("Orientation changed: " + data.newValue);
|
console.log("Orientation changed: " + data.newValue);
|
||||||
vm.set("oreintation", data.newValue);
|
vm.set("orientation", data.newValue);
|
||||||
}
|
}
|
||||||
export function onPageLoaded(args: observable.EventData) {
|
export function onPageLoaded(args: observable.EventData) {
|
||||||
var page = <pageModule.Page>args.object;
|
var page = <pageModule.Page>args.object;
|
||||||
application.on(application.orientationChangedEvent, orientationChanged, page);
|
application.on(application.orientationChangedEvent, orientationChanged, page);
|
||||||
|
|
||||||
page.bindingContext = vm;
|
page.bindingContext = vm;
|
||||||
vm.set("oreintation", "not changed");
|
vm.set("orientation", "not changed");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function onPageUnloaded(args: observable.EventData) {
|
export function onPageUnloaded(args: observable.EventData) {
|
||||||
|
Reference in New Issue
Block a user