Greetings,
I'm trying to simply display a blank textfield (I know), but it's not working?
I must be making some simple error.
Here is开发者_开发百科 my app.js:
Titanium.UI.setBackgroundColor('#FFF');
var win1=Titanium.UI.createWindow({
title:'Login',
backgroundColor:'#FFF'
});
var uname = Titanium.UI.createTextField({
color:'#336699',
height:35,
top:50,
width:250,
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});
win1.add(uname);
Am I missing something? The above should work, right?
I'm using Android emulator on Ubuntu x86_64
When I use tabs the uname and label appear ok:
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win1
});
var uname=Titanium.UI.createTextField({
color:'#336699',
height:35,
top:50,
width:250,
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});
var label1=Titanium.UI.createLabel({
color:'#999',
text:'hello',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
win1.add(uname);
win1.add(label1);
tabGroup.addTab(tab1);
tabGroup.open();
But how do I get rid of the tabs???
I've tried several versions of Android (1.6 API and 2.2 API)
Many thanks in advance,
Update: the solution is: Add the following line: win1.open({fullscreen:true});
is this on the end of you app.js
win1.open({fullscreen:true});
精彩评论