首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >appcelerator createwindow使整扇窗户变黑

appcelerator createwindow使整扇窗户变黑
EN

Stack Overflow用户
提问于 2014-07-22 07:11:54
回答 1查看 568关注 0票数 0

我正在使用钛来开发一个iOS应用程序。我有一个主窗口,我需要在上面打开一个模态窗口。我在模态窗口(附加代码)上设置了一个textArea和两个按钮,用于保存和取消。

问题是当我打开窗户的时候,整个窗户都变黑了。

我做错什么了?谢谢..。

代码语言:javascript
复制
addEvenButton.addEventListener('click', function() {
    var eventDesc = '';
    var t = Titanium.UI.create2DMatrix();
    t = t.scale(0);

    var noteWin = Titanium.UI.createWindow({
        backgroundColor : '#b4be00',
        borderWidth : 8,
        borderColor : '#999',
        height : 460,
        width : 325,
        borderRadius : 10,
        opacity : 0.92,
        modal: true,
        transform : t
    });

    // create first transform to go beyond normal size
    var t1 = Titanium.UI.create2DMatrix();
    t1 = t1.scale(1.1);
    var a = Titanium.UI.createAnimation();
    a.transform = t1;
    a.duration = 1000;

    // when this animation completes, scale to normal size
    a.addEventListener('complete', function() {
        var t2 = Titanium.UI.create2DMatrix();
        t2 = t2.scale(1.0);
        noteWin.animate({
            transform : t2,
            duration : 200
        });

    });
    var noteField = Titanium.UI.createTextArea({
        color : 'black',
        hintText : 'Enter text description here',
        suppressReturn:false,
        height : 200,
        top : 100,
        width : 250,
        keyboardType : Titanium.UI.KEYBOARD_NAMEPHONE_PAD,
        returnKeyType : Titanium.UI.RETURNKEY_DEFAULT,
        borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
    });

    // create a button to close window
    var closeButton = Titanium.UI.createButton({
        title : 'Save text',
        height : 40,
        left : 40,
        top : 50,
        width : 100
    });

    // create a button to close window
    var cancelButton = Titanium.UI.createButton({
        title : 'Cancel',
        height : 40,
        left : 180,
        top : 50,
        width : 100
    });

    noteWin.add(noteField);
    noteWin.add(closeButton);
    noteWin.add(cancelButton);

    closeButton.addEventListener('click', function() {
        var t3 = Titanium.UI.create2DMatrix();
        t3 = t3.scale(0);
        noteWin.close({
            transform : t3,
            duration : 300
        });
        addEvent('Event', noteField.value);
    });

    cancelButton.addEventListener('click', function() {
        var t3 = Titanium.UI.create2DMatrix();
        t3 = t3.scale(0);
        noteWin.close({
            transform : t3,
            duration : 300
        });
    });

    noteWin.addEventListener('singletap', function(e) {
        noteField.blur();
    });
    noteWin.addEventListener('open', function(e) {
        noteField.focus();
    });

    noteWin.open(a);
});
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-07-22 12:33:34

尝试将"zIndex:1000"属性添加到模态窗口,以确保它不会被另一个模式窗口隐藏。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24881017

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档