Quantcast
Viewing all articles
Browse latest Browse all 8068

Why it showing only name label and it's textfield?

Hi

It is showing only name label and it's textfield.When I removed self.add(self1); it is showing password field

//FirstView Component Constructor
function FirstView() {
    //create object instance, a parasitic subclass of Observable
    var self = Ti.UI.createView({
        layout:"vertical"
    });
 
 
        var self1 = Ti.UI.createView({
        layout:"horizontal",
        top:20
    });
 
 
 
        var self2 = Ti.UI.createView({
        layout:"horizontal",
        top:150
    });
 
 
 
    //label using localization-ready strings from <app dir>/i18n/en/strings.xml
 
        var nameLabel=Ti.UI.createLabel({
 
        text:"Name",
 
        left:15,
        width:50,
        height:35
    });
 
 
 
 
    var nameTextField=Ti.UI.createTextField({
 
    height:35,
    width:140,
    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED       
    });
 
        self1.add(nameLabel);
        self1.add(nameTextField);
            self.add(self1);
 
    var passwordLabel=Ti.UI.createLabel({
 
        text:"Password",
        top:150,
        left:15,
        width:50,
        height:35
    });
 
 
 
 
    var passwordTextField=Ti.UI.createTextField({
     top:150,   
    height:35,
    width:140,
    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED       
    });
 
 
 
    self2.add(passwordLabel);
    self2.add(passwordTextField);// self.backgroundImage="http://bluebackground.com/__oneclick_uploads/2008/04/blue_background_03.jpg";
 
    self.add(self2);
    return self;
}
 
module.exports = FirstView;

Viewing all articles
Browse latest Browse all 8068

Trending Articles