潮汐SDK将窗口设置在顶部(透明覆盖)



我想使用 TideSDK 制作一个小应用程序,但希望窗口位于右下角并始终位于其他窗口的顶部

例如,像一个透明的叠加层,显示一个图表或一些信息,无论将焦点切换到其他窗口,这些信息始终可见

这可行吗?

在 tiapp.xml 上定义:

<transparent-background>true</transparent-background>

在 CSS 上定义:

<style type="text/css">
    html, body {
        background : transparent;
    }
</style>

在你的 JavaScript 调用中:

<script type="text/javascript">
    Ti.UI.currentWindow.setTopMost ( true );
    Ti.UI.currentWindow.moveTo ( display.width-your.app.width, display.height-your.app.height );
</script>

最新更新