当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript frame.topmost函数代码示例

本文整理汇总了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();
}
开发者ID:qbert,项目名称:NativeScript,代码行数:35,代码来源:frame-tests-common.ts

示例2: actionBarSetStatusBarStyle

export function actionBarSetStatusBarStyle(style: number) {
	if (topmost().ios) {
		const navigationBar = topmost().ios.controller.navigationBar;
		// 0: default
		// 1: light
		navigationBar.barStyle = style;
	}
}
开发者ID:TheOriginalJosh,项目名称:nativescript-swiss-army-knife,代码行数:8,代码来源:actionBarSetStatusBarStyle.ts

示例3: actionBarHideBackButton

export function actionBarHideBackButton() {
	if (topmost().ios) {
		topmost().ios.controller.visibleViewController.navigationItem.setHidesBackButtonAnimated(
			true,
			false
		);
	}
}
开发者ID:TheOriginalJosh,项目名称:nativescript-swiss-army-knife,代码行数:8,代码来源:actionBarHideBackButton.ts

示例4: actionBarClearButtons

export function actionBarClearButtons() {
	const actionBar = topmost().currentPage.actionBar;
	const actionItems = actionBar.actionItems.getItems();
	actionItems.forEach(item => {
		actionBar.actionItems.removeItem(item);
	});
}
开发者ID:TheOriginalJosh,项目名称:nativescript-swiss-army-knife,代码行数:7,代码来源:actionBarClearButtons.ts

示例5: navigate

export function navigate(args: observable.EventData) {
    var tag = "" + args.object.get("tag");
    __startCPUProfiler("xml-performance-" + tag);
    frame.topmost().navigate({
        moduleName: tag,
    });
}
开发者ID:NathanWalker,项目名称:NativeScript,代码行数:7,代码来源:start.ts

示例6: resetMaury

 resetMaury(args) {
   const img = topmost().getViewById('imageTwo') as Image;
   img.src = null;
   setTimeout(() => {
     img.src = '~/images/maury.jpg';
   }, 100);
 }
开发者ID:bradmartin,项目名称:nativescript-image-filters,代码行数:7,代码来源:main-view-model.ts

示例7: resetBart

 resetBart(args) {
   const img = topmost().getViewById('imageOne') as Image;
   img.src = null;
   setTimeout(() => {
     img.src = '~/images/bart.png';
   }, 100);
 }
开发者ID:bradmartin,项目名称:nativescript-image-filters,代码行数:7,代码来源:main-view-model.ts

示例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
    });
}
开发者ID:slavchev,项目名称:NativeScript,代码行数:30,代码来源:testRunner.ts

示例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;
}
开发者ID:qbert,项目名称:NativeScript,代码行数:25,代码来源:frame-tests-common.ts

示例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 });
}
开发者ID:NathanWalker,项目名称:NativeScript,代码行数:34,代码来源:transition-tests.ts


注:本文中的tns-core-modules/ui/frame.topmost函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。