如何使用钛合金模态窗口?

发布于 2024-12-14 21:20:02 字数 360 浏览 1 评论 0原文

我这里有一个严重的问题。我正在尝试在我的应用程序中使用模式窗口。到目前为止,我只在父窗口上使用了一个窗口。但这导致了无法禁用后台的问题。

这是我的窗口:

在此处输入图像描述

上图中的问题是背景没有被禁用。如果我使用模态窗口,它会占据整个视图,这是我不想要的。

我需要什么:

在此处输入图像描述

我需要一个类似于此警报视图的视图,其中显示了背景进入禁用模式。

非常感谢任何帮助..

谢谢...

i have a serious problem here. i'm trying to use a modal window in my application. till now i used just a window over the parent window. but this caused a problem of not disabling the background.

here is my window:

enter image description here

the problem in the above pic is the background is not being disabled. if i use the modal window it occupies the whole view, which i dont want.

What i'm need of:

enter image description here

i need a view something like this alert view, which wen shown the background goes to disable mode.

any help is highly appreciated..

thank you...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

墨洒年华 2024-12-21 21:20:02

不幸的是,您不能将模式窗口用作对话框,但您可以做一个小技巧,使您的窗口看起来像模式窗口。
创建一个视图并禁用其上的单击事件。将对话窗口添加到此视图并在屏幕上显示此视图。

 var disableView = Titanium.UI.createView({
            height:480,
            width:320,
            top:0,
            backgroundColor:'#000',
            opacity:0.7,
            touchEnabled:true
        });

 disableView.add( yourWindow);

Unfortunately You can not use the modal window as dialog box, but you can do a small trick and make your window look like a modal window.
Create a view and disable the click event on it. Add your dialog window to this view and show this view on screen.

 var disableView = Titanium.UI.createView({
            height:480,
            width:320,
            top:0,
            backgroundColor:'#000',
            opacity:0.7,
            touchEnabled:true
        });

 disableView.add( yourWindow);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文