本文整理匯總了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);