本文整理汇总了TypeScript中tns-core-modules/ui/frame.topmost函数的典型用法代码示例。如果您正苦于以下问题:TypeScript topmost函数的具体用法?TypeScript topmost怎么用?TypeScript topmost使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了topmost函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test_frame_retrieval_API_when_navigating
export function test_frame_retrieval_API_when_navigating() {
const rootView = getRootView();
const initialFrame = new Frame();
initialFrame.id = "initialFrame";
initialFrame.navigate(() => new Page());
const initialTopmost = topmost();
const initialFrameById = getFrameById("initialFrame");
TKUnit.assertEqual(initialTopmost, initialFrame);
TKUnit.assertEqual(initialFrameById, initialFrame);
const newFrame = new Frame();
newFrame.id = "newFrame";
newFrame.navigate(() => new Page());
const newTopmost = topmost();
const newFrameById = getFrameById("newFrame");
TKUnit.assertEqual(newTopmost, newFrame);
TKUnit.assertEqual(newFrameById, newFrame);
initialFrame.navigate(() => new Page());
const previousTopmost = topmost();
const previousFrameById = getFrameById("initialFrame");
TKUnit.assertEqual(previousTopmost, initialFrame);
TKUnit.assertEqual(previousFrameById, initialFrame);
// clean up the frame stack
initialFrame._removeFromFrameStack();
newFrame._removeFromFrameStack();
}
示例2: actionBarSetStatusBarStyle
export function actionBarSetStatusBarStyle(style: number) {
if (topmost().ios) {
const navigationBar = topmost().ios.controller.navigationBar;
// 0: default
// 1: light
navigationBar.barStyle = style;
}
}
示例3: actionBarHideBackButton
export function actionBarHideBackButton() {
if (topmost().ios) {
topmost().ios.controller.visibleViewController.navigationItem.setHidesBackButtonAnimated(
true,
false
);
}
}
示例4: actionBarClearButtons
export function actionBarClearButtons() {
const actionBar = topmost().currentPage.actionBar;
const actionItems = actionBar.actionItems.getItems();
actionItems.forEach(item => {
actionBar.actionItems.removeItem(item);
});
}
示例5: navigate
export function navigate(args: observable.EventData) {
var tag = "" + args.object.get("tag");
__startCPUProfiler("xml-performance-" + tag);
frame.topmost().navigate({
moduleName: tag,
});
}
示例6: resetMaury
resetMaury(args) {
const img = topmost().getViewById('imageTwo') as Image;
img.src = null;
setTimeout(() => {
img.src = '~/images/maury.jpg';
}, 100);
}
示例7: resetBart
resetBart(args) {
const img = topmost().getViewById('imageOne') as Image;
img.src = null;
setTimeout(() => {
img.src = '~/images/bart.png';
}, 100);
}
示例8: showReportPage
function showReportPage(finalMessage: string) {
const stack = new StackLayout();
const btn = new Button();
btn.text = "Rerun tests";
btn.on("tap", () => runAll(testsSelector));
stack.addChild(btn);
const messageContainer = new TextView();
messageContainer.editable = messageContainer.autocorrect = false;
messageContainer.text = finalMessage;
stack.addChild(messageContainer);
topmost().navigate({
create: () => {
const page = new Page();
page.content = stack;
messageContainer.focus();
page.style.fontSize = 11;
if (platform.isAndroid) {
page.on('navigatedTo', () => {
messageContainer.focus();
setTimeout(() => messageContainer.dismissSoftInput());
});
}
return page;
},
clearHistory: true
});
}
示例9: test_page_parent_when_navigate_with_clear_history
export function test_page_parent_when_navigate_with_clear_history() {
const frame = topmost();
const pages = new Array<Page>();
const create = () => {
const page = new Page();
pages.push(page);
return page;
};
frame.navigate({ create });
frame.navigate({ create, backstackVisible: false });
frame.navigate({ create });
frame.navigate({ create: () => new Page(), clearHistory: true });
TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty(), NAV_WAIT);
TKUnit.assertEqual(pages.length, 3);
TKUnit.assertEqual(frame.backStack.length, 0);
pages.forEach(p => {
TKUnit.assertNull(p.parent);
TKUnit.assertNull(p.frame);
});
pages.length = 0;
}
示例10: test_Transitions
export function test_Transitions() {
const topmost = topmostFrame();
const mainTestPage = topmost.currentPage;
const mainPageFactory = function (): Page {
return mainTestPage;
};
helper.navigate(() => {
const page = new Page();
page.id = "TransitionsTestPage_MAIN"
page.style.backgroundColor = new Color(255, Math.round(Math.random() * 255), Math.round(Math.random() * 255), Math.round(Math.random() * 255));
return page;
});
var transitions;
if (platform.device.os === platform.platformNames.ios) {
transitions = ["curl"];
} else {
const _sdkVersion = parseInt(platform.device.sdkVersion);
transitions = _sdkVersion >= 21 ? ["explode"] : [];
}
transitions = transitions.concat(["fade", "slide"]);
// Custom transition
_testTransition({ instance: new CustomTransition(), duration: 10 });
// Built-in transitions
transitions.forEach(name => {
_testTransition({ name, duration: 20, curve: AnimationCurve.easeIn });
});
// helper.navigateWithEntry({ create: mainPageFactory, clearHistory: true, animated: false });
}