Fix: refresh flat property on change in IOS (#4628)

* Fix: refresh flat property on change in IOS

* Fix typos
This commit is contained in:
Alexander Vakrilov
2017-08-01 10:40:51 +03:00
committed by SvetoslavTsenov
parent d949cc7128
commit 2dbd1b19ea
3 changed files with 21 additions and 12 deletions

View File

@@ -1,15 +1,17 @@
import { Label } from "tns-core-modules/ui/Label";
import { Page } from "tns-core-modules/ui/Page";
import { Label } from "tns-core-modules/ui/label";
import { Page } from "tns-core-modules/ui/page";
export function onNavigateTo(args) {
const actionBar = (<Page>args.object).actionBar;
args.object.flatPropertyValue = <Label>args.object.getViewById("flatPropertyValue");
actionBar.flat = true;
args.object.flatPropertyValue.text = "Action bar flat property is set to: " + actionBar.flat;
updateText(args.object);
}
export function changeFlatPropertyValue(args) {
const actionBar = (<Page>args.object.page).actionBar;
actionBar.flat = !actionBar.flat;
args.object.page.flatPropertyValue.text = "Action bar flat property is set to: " + actionBar.flat;
}
const page = <Page>args.object.page;
page.actionBar.flat = !page.actionBar.flat;
updateText(page);
}
function updateText(page: Page) {
const label = <Label>page.getViewById("flatPropertyValue");
label.text = "Action bar flat property is set to: " + page.actionBar.flat;
}

View File

@@ -1,6 +1,6 @@
<Page navigatedTo="onNavigateTo" >
<Page.actionBar>
<ActionBar title="Flat property" />
<ActionBar title="Flat property"/>
</Page.actionBar>
<StackLayout>
<Button margin="30" text="change flat property" tap="changeFlatPropertyValue"/>