Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (keyboard)
Viewing all articles
Browse latest Browse all 352

Problem with not clickable TextField

$
0
0

I am using Titanium 3.2.0 Windows 7/Android. I am creating TextField in a View (which is in a View), but when I am clicking it, the keyboard is not initialized. The applications recognizes click only for the top View, View inside of it is not responding for a click, the same as TextField. I suppose I should use bubbling or the problem is different?

Here is some code:

exports.settingsContent = function(pWidth, pHeight) {
 
    var settingsContent = Ti.UI.createView({
        top : pWidth / 7.1,
        width : pWidth * 0.9,
        bottom : pWidth / 6.4,
        layout : 'vertical'
    });
 
 
 
    var settingsContainer = Ti.UI.createView({
        backgroundColor : '#ebeced',
        borderRadius : 30,
        borderWidth : 0,
        height : '203dp',
        layout : 'vertical'
    });
 
    var myObj = [];
 
    for ( i = 0; i < 4; ++i) {
 
        myObj['settingViewLine' + i] = Ti.UI.createView({
            height : '50dp',
            width : '90%'
        });
 
        var labelText;
 
        switch(i) {
            case 0:
                labelText = 'Födelseart';
                break;
            case 1:
                labelText = 'Kön';
                break;
            case 2:
                labelText = 'Postnummer';
                break;
            case 3:
                labelText = 'E-mail';
                break;
        }
 
        var label = Titanium.UI.createLabel({
            text : labelText,
            left : 0,
            color : '#67696b',
            font : {
                fontSize : '18sp',
                fontFamily : myApp.helveticaNL,
                fontStyle : 'bold'
            }
        });
 
        myObj['settingViewLine' + i + 'left'] = Ti.UI.createView({
            height : '50dp',
            width: '120dp',
            backgroundColor : '#f00',
            left : 0
        });
 
        myObj['settingViewLine' + i + 'left'].add(label);
        myObj['settingViewLine' + i].add(myObj['settingViewLine' + i + 'left']);
 
        myObj['settingViewLine' + i + 'middle'] = Ti.UI.createView({
            height : '50dp',backgroundColor : '#0f0',
            left: '120dp',
            width: '120dp',
        });
 
        //add textfield
        var textArea = Ti.UI.createTextField({
            borderWidth : 0,
            backgroundColor : 'transparent',
            color : '#888',
            width: '120dp',
            font : {
                fontSize : '12sp',
            },
            value: 'q',
            keyboardType : Ti.UI.KEYBOARD_DEFAULT,
            returnKeyType : Ti.UI.RETURNKEY_GO,
            textAlign : 'left',
        });
 
 
 
        myObj['settingViewLine' + i + 'middle'].add(textArea);
 
        myObj['settingViewLine' + i].add(myObj['settingViewLine' + i + 'middle']);
 
        myObj['settingViewLine' + i + 'right'] = Ti.UI.createView({
            height : '50dp',
            right : 0
        });
 
        myObj['settingViewLine' + i + 'rightImage'] = Ti.UI.createImageView({
            image : '/images/rectangle.png',backgroundColor : '#00f',
            right : 0
        });
 
        myObj['settingViewLine' + i + 'right'].add(myObj['settingViewLine' + i + 'rightImage']);
        myObj['settingViewLine' + i].add(myObj['settingViewLine' + i + 'right']);
 
        settingsContainer.add(myObj['settingViewLine' + i]);
 
        if (i < 3) {
            myObj['settingViewLine' + i + 'line'] = Ti.UI.createImageView({
                image : '/images/line.png',
                width : '100%'
            });
 
            settingsContainer.add(myObj['settingViewLine' + i + 'line']);
        }
    }
 
 
    settingsContent.add(settingsContainer);
 
    return settingsContent;
 
};

Viewing all articles
Browse latest Browse all 352

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>