fabio.geraci
fabio.geraci

Reputation: 325

borderStyle appcelerator

I have the following code, but the result is quite different from what I thought was going to be (ios verion).

What am I doing wrong?

//creating the textfield for our loan amount input
var tfAmount = Titanium.UI.createTextField({
    width: 140,
    height: 30,
    top: 100,
    right: 20,
    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
    returnKeyType:Titanium.UI.RETURNKEY_DONE,
    hintText: '1000.00',
    keyboardToolbar: [flexSpace,buttonDone],
    keyboardType:Titanium.UI.KEYBOARD_PHONE_PAD
});
view.add(tfAmount);

enter image description here

enter image description here

Upvotes: 0

Views: 2215

Answers (1)

Muhammad Adnan
Muhammad Adnan

Reputation: 2668

Try this code. Its working fine for me.

   var win = Titanium.UI.createWindow({
    backgroundColor : 'black'
});
var view = Titanium.UI.createView({
    backgroundColor : 'pink',
    top : '2%',
    height : '40%'
});
win.add(view);

/* Loan Label and TextField*/

var loanLabel = Titanium.UI.createLabel({
    top : '5%',
    left : '1%',
    width : Titanium.UI.SIZE,
    height : Titanium.UI.SIZE,
    color : 'black',
    text : 'Loan amount : $ ',
    font : {
        fontWeight : 'bold'
    }

})

view.add(loanLabel);
var loanAmount = Titanium.UI.createTextField({
    width : '50%',
    height : Titanium.UI.SIZE,
    top : '5%',
    //color: 'black',
    right : '1%',
    borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
    returnKeyType : Titanium.UI.RETURNKEY_DONE,
    hintText : '1000.00',
    keyboardType : Titanium.UI.KEYBOARD_PHONE_PAD
});
view.add(loanAmount);

/* Interest Rate Label and TextField*/
var irLabel = Titanium.UI.createLabel({
    top : '50%',
    left : '1%',
    width : Titanium.UI.SIZE,
    height : Titanium.UI.SIZE,
    color : 'black',
    text : 'Interest Rate : % ',
    font : {
        fontWeight : 'bold'
    }

})

view.add(irLabel);
var tfAmount = Titanium.UI.createTextField({
    width : '50%',
    height : Titanium.UI.SIZE,
    top : '50%',
    //color: 'black',
    right : '1%',
    borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
    returnKeyType : Titanium.UI.RETURNKEY_DONE,
    value : '6',
    borderColor : 'none',
    font : {
        fontWeight : 'bold'
    },
    keyboardType : Titanium.UI.KEYBOARD_PHONE_PAD
});
view.add(tfAmount);

win.open();

Upvotes: 3

Related Questions