Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Resize TextFiled and Button

$
0
0

Application type: mobile Titanium SDK: 3.3.0 Platform & version: Android Device: physical device model I9305 Host Operating System: Windows 8 Titanium Studio: build: 3.3.0.201407100905

Hi, I'm trying to resize my TextField and Button but when I write my function inizializzaElementi(e) elements disappears :(

index.xml

<Alloy>
    <Window class="container" onOpen='inizializzaElementi'>
        <TextField id='username' />
        <TextField id='password' />
        <Button id='login' />
    </Window>
</Alloy>
index.tss
//
// Frame / Typography
//
"Window": {
    backgroundColor:"white",
    navBarHidden:true
}
 
".container": {
    backgroundColor:"#355292",
}
 
//
// Form
//
'Button': {
    width: 600,
    height: Ti.UI.SIZE,
    backgroundColor: "white",
    borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
    autocapitalization: Ti.UI.TEXT_AUTOCAPITALIZATION_NONE
}
 
'TextField': {
    width: Ti.UI.SIZE,
    height: Ti.UI.SIZE,
    backgroundColor: "white",
    borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
    autocapitalization: Ti.UI.TEXT_AUTOCAPITALIZATION_NONE
}
//
// Components
//
"#username": {
    top: 350,
    hintText:'Username',
    borderRadius:10,
    keyboardType:Titanium.UI.KEYBOARD_DEFAULT,
    returnKeyType:Titanium.UI.RETURNKEY_DEFAULT,
    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
}
 
"#password": {
    top: 450,
    hintText:'Password',
    passwordMask:true,
    borderRadius:10,
    keyboardType:Titanium.UI.KEYBOARD_DEFAULT,
    returnKeyType:Titanium.UI.RETURNKEY_DEFAULT,
    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
}
 
"#login": {
    top: 550,
    title:'Login',
    color: "white",
    borderRadius:10,
    backgroundColor: '#223b73',
    font:{fontFamily:'Arial',fontWeight:'bold',fontSize:44}
}
index.js
function inizializzaElementi(e){
    $.username.width = $.index.width-40;
    $.password.width = $.index.width-40;
    $.login.width = $.index.width-40;
};
$.index.open();
I have one more problem tryint to hide the Application BarName... I tried with navBarHidden:true but doesn't work.

regards, Matteo


Viewing all articles
Browse latest Browse all 8068

Trending Articles



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