本文整理汇总了TypeScript中tns-core-modules/ui/frame.Frame类的典型用法代码示例。如果您正苦于以下问题:TypeScript Frame类的具体用法?TypeScript Frame怎么用?TypeScript Frame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Frame类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: createFrame
function createFrame(i: number, page: Page) {
const frame = new Frame();
frame.navigate(() => page);
frame.id = `Tab${i} Frame${i}`;
return frame;
}
示例2: topmost
exports.secondaryActionTap = args => {
googleAnalytics.logEvent({
category: "Basic Actions",
action: "Click",
label: "Secondary Button"
});
const topmostFrame: Frame = topmost();
topmostFrame.navigate("secondary-page");
};
示例3: tearDownModule
export function tearDownModule() {
const page = new Page();
const frame = new Frame();
frame.navigate(() => page);
const entry: NavigationEntry = {
create: () => frame
};
waitUntilNavigatedToMaxTimeout([page], () => _resetRootView(entry));
}
示例4: onModalFrame
export function onModalFrame(args: EventData) {
const view = args.object as View;
const frame = new Frame();
frame.navigate("modal/modal-page");
view.showModal(frame,
"context",
() => console.log("home-page modal frame closed"),
false);
}
示例5: createTestFrameRootEntry
function createTestFrameRootEntry() {
const page = new Page();
const frameRoot = new Frame();
frameRoot.navigate(() => page);
const entry: NavigationEntry = {
create: () => frameRoot
};
return {
entry: entry,
root: frameRoot,
page: page
};
}
示例6: 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();
}
示例7: function
btnActivity.on(button.Button.tapEvent, function () {
var newFrame = new frame.Frame();
var newPage = "tests/pages/navigation/pageA-new-activity";
newFrame.navigate(newPage);
});
示例8: wireEvents
function wireEvents(){
page.getViewById("genstureSwipe").on("swipe", (args: SwipeGestureEventData) => {
googleAnalytics.logEvent({
category: "Gestures",
action: "Swipe",
label: "Direction: " + args.direction,
value: args.direction
});
showMessage("Swipe Direction: " + args.direction);
console.log("Swipe Direction: " + args.direction);
});
page.getViewById("genstureLongTap").on("longPress", args => {
googleAnalytics.logEvent({
category: "Gestures",
action: "Long Press",
label: "Long press on screen"
});
showMessage("Long Press");
console.log("Long Press");
});
}
示例9:
TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty(), NAV_WAIT);